Re: SMTP via GMAIL

2008-08-04 Thread Tim Roberts
w Interesting. If true, that is incorrect behavior. >And does anyone have a general routine that lets one also have Bcc: >addresses usign SMTP? To make a Bcc, all you do is include the address in the RECEIVERS list, but don't mention it in the body at all. -- Tim Roberts, [E

Re: Calculate sha1 hash of a binary file

2008-08-06 Thread Tim Golden
LaundroMat wrote: Hi - I'm trying to calculate unique hash values for binary files, independent of their location and filename, and I was wondering whether I'm going in the right direction. Basically, the hash values are calculated thusly: f = open('binaryfile.bin') import hashlib h = hashlib.

Re: More Datastore Examples Please

2008-08-06 Thread Tim Roberts
u trying to DO with the datastore? -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimals not equalling themselves (e.g. 0.2 = 0.2000000001)

2008-08-07 Thread Tim Rowe
ith less sand and more dirt. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: CAB files

2008-08-08 Thread Tim Golden
Virgil Stokes wrote: I would appreciate python code for creating *.cab files. I'm not aware of any existing modules for creating CABs. I thought there were some MS API calls for doing that kind of thing but a quick search hasn't shown anything up. You may have to roll your own: http://support

Re: mktime overflow in March 2008?

2008-08-09 Thread Tim Roberts
>> time.mktime(t) >Traceback (most recent call last): > File "", line 1, in >OverflowError: mktime argument out of range What time zone are you in? March 30, 2008, was a Sunday. If that happened to be the date your country transitioned to summer time, th

Re: Win32 trouble with threading, signals, and sleep()

2008-08-09 Thread Tim Golden
Lowell Alleman wrote: I'm running into this issue on Windows with the follow exception at the time when the signal handler is called: Traceback (most recent call last): ... self.done.wait(30) File "D:\Python24\lib\threading.py", line 348, in wait self.__cond.wait(timeout) File "D:

Re: Broken examples

2008-08-11 Thread Tim Roberts
norseman wrote: Tim; Finally got a chance to test your snippet. Thank you for it! I took the liberty of flushing it out a bit. #!/--- # import os import win32com.client excel = win32com.client.Dispatch( 'Excel.Application' ) excel.Visible=1#

Re: very rare python expression

2008-08-12 Thread Tim Golden
甜瓜 wrote: Howdy everyone, I saw a strange python code in pygame project. What does "while not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" is not HTML strings. Well I can't say I'd format it that way myself, but it is valid. More conventionally laid out the expression look

Re: very rare python expression

2008-08-12 Thread Tim Golden
甜瓜 wrote: Howdy everyone, I saw a strange python code in pygame project. What does "while not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" is not HTML strings. Well I can't say I'd format it that way myself, but it is valid. More conventionally laid out the expression look

Re: What motivates all unpaid volunteers at Pycon?

2008-03-29 Thread Tim Chase
> I was wondering what motivated so many people to give so much to the > Python community. fear, surprise, ruthless efficiency, an almost fanatical devotion to the BDFL, and nice red uniforms. Oh... -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Change user on UNIX

2008-03-29 Thread Tim Roberts
asonable? Typically, an FTP server dedicates one thread/process per logged in session. That process changes to the logged in user's identity as soon as it gets the username and password, and stays there forever. There is no need to switch back to root in between. The principle o

Re: Problem with sqlite

2008-03-29 Thread Tim Roberts
ate a clean slate database file And such gluing is a very bad idea, because it is apparently hiding the real cause of your problems. Get rid of the try/except/pass sequences until you understand what is failing. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rubik's cube translation

2008-03-30 Thread Tim Leslie
0], >[7, 4, 1], >[8, 5, 2]]) In [10]: numpy.rot90(a, 3) Out[10]: array([[6, 3, 0], [7, 4, 1], [8, 5, 2]]) Tim > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding Full Path to Process EXE

2008-03-31 Thread Tim Golden
[EMAIL PROTECTED] wrote: > That's not a problem - I'm only interested in Win2k+. Thanks for the > caveat. > > On a similar note, is there a way (preferably using WMI) to get the > full path to the executable that has a port open (the same thing that > fport does, just implemented in Python)? It

Re: Rubik's cube translation

2008-03-31 Thread Tim Roberts
, 0, 0], > [0, 0, 0]]) > >? If you don't want changes to D to affect E, then you need to disconnect them when you create them. If you create D and E so that they contain references to the same lists, then this kind of thing will happen. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: CTypes, 64 bit windows, 32 bit dll

2008-03-31 Thread Tim Roberts
2bit or 64bit, no mixed ... > >Crap, no way to make a 32 bit load, even using the wowexec? No. In Win64, a process is either entirely 32-bit, or entirely 64-bit. To do the kind of crossing you seek, you would need to create a separate process for the 32-bit DLL and use interprocess communication. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Directed Graph Traversal

2008-04-01 Thread Tim Daneliuk
A, B, F => ABEF (or ABCF) > A, F, C => ABCF > A, E, D => ABCD >E > > Thanks! > --Buck This leaps to mind: http://en.wikipedia.org/wiki/Kruskal's_algorithm The implementation details are left to the reader ;) -- ---

Re: Why prefer != over <> for Python 3.0?

2008-04-02 Thread Tim Roberts
a generic Sudoku solver in a 65-byte executable. Yes, that's 65 BYTES -- not KB, not MB. I consider myself an x86 assembler expert, but I remain in awe of that code. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for low-level Windows programming

2008-04-03 Thread Tim Golden
haxier wrote: > I've some experience with Python in desktop apps, but now I'm looking > to code a tool like Kee-Pass[1] which must have access to some low- > level primitives in a windows environment: hooks when windows are > displayed, automatic form fill, and so on in a variety of scenarios > (de

Re: object-relational mappers

2008-04-03 Thread Tim Golden
Paul Boddie wrote: > ... I've come to realise that most object-relational mappers are > solving the wrong problems: they pretend that the database is somehow > the wrong representation whilst being a fast enough black box for > holding persistent data (although I doubt that many people push the > b

Re: object-relational mappers

2008-04-03 Thread Tim Golden
Marco Mariani wrote: > Tim Golden wrote: > >> I've recently used Elixir and found it very useful for a small-scale >> database with no more than a dozen tables, well-structured and >> easily understood. I'd certainly use it again for anything like that >>

Re: while-loops enter the last time after condition is filled?

2008-04-05 Thread Tim Chase
> it seems to me from my results that when i use a while-loop it > will execute once after the condition is met. Nope. > ie the conditions is met the code executes one time more and > then quits. Must be that your conditional is wrong, or your conditions are not updated the way you think they a

Re: Best way to check if string is an integer?

2008-04-05 Thread Tim Chase
> I always do it the first way. It is simpler, and should be faster. Ditto. Using int() is best. It's clear, it's correct, and it should be as fast as it gets. >> if c in '0123456789': >>print "integer" >> else: >>print "char" > > Also, the second way will only work on single-digit num

set file permission on windows

2008-04-08 Thread Tim Arnold
all I know is the Group names and the permissions I need to allow. thanks for any pointers, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: set file permission on windows

2008-04-08 Thread Tim Arnold
"Mike Driscoll" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Apr 8, 12:03 pm, "Tim Arnold" <[EMAIL PROTECTED]> wrote: >> > According to the following thread, you can use os.chmod on Windows: > > http://mail.python.org/p

Re: set file permission on windows

2008-04-08 Thread Tim Golden
Tim Arnold wrote: > "Mike Driscoll" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Apr 8, 12:03 pm, "Tim Arnold" <[EMAIL PROTECTED]> wrote: >>> > >> According to the following thread, you can use os.chmod

Re: new user needs help!

2008-04-08 Thread Tim Chase
> f = open("/tmp/data.txt", 'w') > > will open that file. > > You can throw the first line away with > > headings = f.next() > > Then you can loop over the rest with > > for name, aa, topo, access, dssp, stride, z in file: > # > # Then process each line here Small caveat here...Ste

Re: set file permission on windows

2008-04-09 Thread Tim Arnold
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tim Arnold wrote: >> "Mike Driscoll" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> On Apr 8, 12:03 pm, "Tim Arnold" <[EMAIL PROT

Re: Data structure recommendation?

2008-04-09 Thread Tim Roberts
index that is 1.6-0.4 and one index that is 0.8+0.4, and the two won't be the same. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find documentation about methods etc. for iterators

2008-04-10 Thread Tim Chase
> First question, what sort of 'thing' is the file object, I need to > know that if I'm to look up ways of using it. you can always use type(thing) to find out what type it is. > Second question, even if I know what sort of thing a file object > is, how do I find methods appl

Re: Convert PyIDispatch object to struct IDispatch*

2008-04-11 Thread Tim Golden
Huayang Xia wrote: > On Apr 11, 12:15 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <[EMAIL PROTECTED]> >> escribió: >> >>> I am trying to use ctypes to call dll functions. One of the functions >>> requires argument "struct IDispatch* ". I d

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Tim Golden
rdahlstrom wrote: > On Apr 11, 1:45 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: >> Does anyone know how to determine the window status (Running or Not >> Responding)? I've tried various methods with no success... >> >> This would be on a variety of Windows systems, but all at least XP, >> and mostly

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Tim Golden
Mike Driscoll wrote: > http://www.informit.com/articles/article.aspx?p=19489&seqNum=4 > > If you're better than I am, you can probably translate this to the > Python equivalent. Zenoss also has some monitoring software that's > open source Python code. I'm afraid that article only allows you to d

Re: Windows - window status (Running vs Not Responding)

2008-04-11 Thread Tim Golden
Ross Ridge wrote: > rdahlstrom <[EMAIL PROTECTED]> wrote: >> Basically, I'm looking for something similar to the Process.Responding >> property in System.Diagnostics... > > You probably want to use IsHungAppWindow(): Brilliant! So simple when you find out. Thanks. (Added to my list of things I

Re: Recommended "from __future__ import" options for Python 2.5.2?

2008-04-12 Thread Tim Golden
Malcolm Greene wrote: > Is there a consolidated list of "from __future__ import" options to > choose from? Well, that bit's easy: import __future__ print __future__.all_feature_names TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: email module windows and suse

2008-04-13 Thread Tim Roberts
't go any faster than your slowest link. >Are threads available and as effective in SUSE as they are in Windows? Threads are available in Linux. There is considerable debate over the relative performace improvement. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Process multiple files

2008-04-14 Thread Tim Chase
> new_file = open('filename.txt', 'w') > params = open('eggs.txt', 'r') > do all the python stuff here > new_file.close() > > If these files followed a naming convention such as 1.txt and 2.txt I > can easily see how these could be parsed consecutively in a loop. > However, they are not and

Re: Get oldest folder

2008-04-15 Thread Tim Golden
[EMAIL PROTECTED] wrote: > I'd like to be able to get the path to the oldest folder in whatever > directory I'm currently in. And just because I'm feeling silly: import os print os.popen ("dir /b /ad /od /tc c:\python25\lib\site-packages").readline () TJG -- http://mail.python.org/mailma

Re: Get oldest folder

2008-04-15 Thread Tim Golden
[EMAIL PROTECTED] wrote: > I'd like to be able to get the path to the oldest folder in whatever > directory > I'm currently in. Is there a simple way to go about this? > I'd like it to run on both OS X and Windows XP. > I found this example but was curious if there's a better way to do this?

Re: Recurring patterns: Am I missing it, or can we get these added to the language?

2008-04-15 Thread Tim Chase
>> def nsplit(s,p,n): >> n -= 1 >> l = s.split(p, n) >> if len(l) < n: >> l.extend([''] * (n - len(l))) >> return l > > The split() method has a maxsplit parameter that I think does the same > thing. For example: > temp = 'foo,bar,baz' temp.split(',', 1) > ['foo'

Re: vary number of loops

2008-04-16 Thread Tim Chase
> I'm new to Python and the notion of lambda, and I'm trying to write a > function that would have a varying number of nested for loops > depending on parameter n. This just smells like a job for lambda for > me, but I can't figure out how to do it. Any hint? I'm not sure lambda is the tool to use

Re: I just killed GIL!!!

2008-04-16 Thread Tim Daneliuk
laptop. > > > > If I were you I would keep it a secret until a Hollywood producer > offers big bucks for the film rights. Who would play Guido, I wonder? -- Tim Daneliuk [EMAIL PROTECTED] PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

Re: I just killed GIL!!!

2008-04-17 Thread Tim Daneliuk
MRAB wrote: > On Apr 17, 5:22 am, Torsten Bronger <[EMAIL PROTECTED]> > wrote: >> Hallöchen! >> >> Tim Daneliuk writes: >>> Daniel Fetchinson wrote: >>>> [...] >>>>> I just had one moment of exceptional clarity, during whi

how do I know if I'm using a debug build of python

2008-04-17 Thread Tim Mitchell
Hi, A quick question: Is there any way for a python script to know if it's being executed by a debug build of python (python_d.exe) instead of python? Thanks Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: why function got dictionary

2008-04-18 Thread Tim Roberts
to include support functions that should not be exposed as web pages. To do that, you just add an "exposed" attribute to the function: class MyWebPage: ... def index( self, ... ): pass index.exposed = 1 def notExposed( self, ... ): pass def request

Re: Excel Manipulation using Python

2008-04-18 Thread Tim Golden
Krishna wrote: > I was trying to delete rows in an existing .xls file using python. How > do I do that? I was using the following code, it seem to work if I > type in python window, but if I save it in text editor and drage and > drop the .py file, it doesnt work. What am I doing wrong here? Thank

Re:

2008-04-18 Thread Tim Golden
SPJ wrote: > I am writing a script which need's to convert an excel file to > csv (text) format. For that I am using the following code: > > excel = win32com.client.Dispatch("Excel.Application","Quit") > workbook = excel.Workbooks.Open(xlsfile) > workbook.SaveAs(csvfile, FileFormat=2

Re: [Python 2.4/2.5] subprocess module is sorely deficient?

2008-04-22 Thread Tim Golden
Harishankar wrote: On Tuesday 22 Apr 2008 18:00:02 Nick Craig-Wood wrote: There is a recipe in the cookbook http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 Which I've used and it works. Thanks. I found that recipe too. I was hoping I could cook up something similar without ha

Re: Where to get BeautifulSoup--www.crummy.com appears to be down.

2008-04-23 Thread Tim Golden
John Nagle wrote: Mike Driscoll wrote: Ken, On Tue, Apr 22, 2008 at 1:36 PM, Kenneth McDonald <[EMAIL PROTECTED]> wrote: Sadly. Thanks, Ken -- http://mail.python.org/mailman/listinfo/python-list I've attached the 2.4 version. I also have some Windows binaries for Beautiful Soup uploade

Re: Partition list with predicate

2008-04-23 Thread Tim Golden
Jared Grubb wrote: I want a function that removes values from a list if a predicate evaluates to True. The best I could come up with is: Have a look at the itertools module, and the ifilter function in particular. TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: python-ldap - Operations Error

2008-04-24 Thread Tim Golden
Michael Ströder wrote: Jason Scheirer wrote: On Apr 23, 5:16 pm, [EMAIL PROTECTED] wrote: Hello all, I am trying to integrate TurboGears with our Active Directory here at the office. TurboGears aside, i cannot get this to work. Seems more promising: http://tgolden.sc.sabren.com/python/activ

convert xhtml back to html

2008-04-24 Thread Tim Arnold
to figure out that lookahead stuff. I'm not sure where to start now; I looked at BeautifulSoup and BeautifulStoneSoup, but I can't see how to modify the actual tag. thanks, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: convert xhtml back to html

2008-04-24 Thread Tim Arnold
"Gary Herron" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tim Arnold wrote: >> hi, I've got lots of xhtml pages that need to be fed to MS HTML Workshop >> to create CHM files. That application really hates xhtml, so I need to >> conv

Re: convert xhtml back to html

2008-04-24 Thread Tim Arnold
"Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Tim Arnold" <[EMAIL PROTECTED]> writes: > >> hi, I've got lots of xhtml pages that need to be fed to MS HTML Workshop >> to >> create CHM files.

Re: convert xhtml back to html

2008-04-25 Thread Tim Arnold
xml when I move to RH linux next month. I've been using hp10.20 and never could get the requisite libraries to compile. Once I make that move, maybe I won't have as many markup related questions here! thanks again to all for the great suggestions. --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Printing using win32print

2008-04-29 Thread Tim Golden
José Roberto wrote: Olá KellyK! I have read your comentary about how to print with python in windows using win32print. I have trying to use in my problem : print a figure (.jpg, .png...etc) could you help me? Does this help? http://timgolden.me.uk/python/win32_how_do_i/print.html#rough_and_re

Re: File IO Issues, help :(

2008-04-29 Thread Tim Roberts
) > >I tried this can got the same result...?? That's not what he meant. He meant: jsfile = open("../timeline.js", "r") jscontent = jsfile.readlines() jsfile.close() jsfile = open("../timeline.js", "w") ...etc... You have to decide whether this makes m

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-01 Thread Tim Roberts
, since Python is nearly ubiquitous, I suspect it is not so important. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding Text

2008-05-04 Thread Tim Golden
Paul Jefferson wrote: I'm learning this and I'm making a program which takes RSS feeds and processes them and then outputs them to a HTML file. The problem I have is that some of the RSS feeds contain chachters which I think are outside of the ascii range as when I attempt to write the file con

Re: USB HID documentation?

2008-05-05 Thread Tim Roberts
a custom driver. For low-bandwidth data sources, USB HID is an excellent way to provide general-purpose access to a USB device. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: listing computer hard drives with python

2008-05-06 Thread Tim Golden
Ohad Frand wrote: I am looking for a way to get a list of all active logical hard drives of the computer (["c:","d:"..]) You can do this with WMI [*] under Windows: import wmi c = wmi.WMI () for i in c.Win32_LogicalDisk (): print i.Caption If you want only fixed disks (ie exluding externa

Re: Scanning through Windows registry...

2008-05-06 Thread Tim Golden
Unknown Hero wrote: Hi everyone! Well, I have this need for a Python script that will scan through a selected hive (like HKEY_LOCAL_MACHINE) and replace all strings that contain word xxx (IE. foo) with yyy (IE. moo). I do not want partial results, but rather complete strings (no foome or the lik

Re: Scanning through Windows registry...

2008-05-06 Thread Tim Golden
Unknown Hero wrote: So basically I am looking for these things: 1) Read one subkey from HKEY_LOCAL_MACHINE at a time (I think QueryValueEx() is needed here) 2) Check if said subkey contains some predetermined string (like 'foo' here) 3) If the above applies, change the value into another predete

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
Unknown Hero wrote: Tim Golden wrote: [... snip long example ...] Correct me if I'm wrong (which I just might be), but doesn't the above code go through the keys behind HKEY_LOCAL_MACHINE\Software\Timsoft\ ? Is it possible to use an empty value in: hTimSoft = _winreg.OpenKe

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
In a spirit of being helpful... :) The code below (which I imagine every Windows programmer writes sometime in their Python life) mimics the os.walk functionality, yielding the key, subkeys, and values under a particular starting point in the registry. The "if __name__ == '__main__'" test run at

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
Mike Driscoll wrote: On May 7, 4:45 am, Tim Golden <[EMAIL PROTECTED]> wrote: In a spirit of being helpful... :) [... snip registry walker ...] This is pretty cool stuff, Tim. Of course, it would also seriously screw up some programs if you decided to replace the wrong phrase. Just

Re: strftime() argument 1 must be str, not unicode

2008-05-08 Thread Tim Roberts
? I think that's a perfectly reasonable thing to expect. At the risk of over-generalization, there is no good reason why, by this point in time, all of the standard library routines that accept strings shouldn't also accept Unicode strings. It's the duck typing principle. Unicode strings look, walk, and talk like regular strings. An error like this is not intuitive. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: PCBuild.sin - Attempt to compile Python using Visual Studio 2008

2008-05-08 Thread Tim Golden
Gabriel Genellina wrote: En Thu, 08 May 2008 09:55:36 -0300, Colin J. Williams <[EMAIL PROTECTED]> escribió: The readme.txt has: All you need to do is open the workspace "pcbuild.sln" in Visual Studio, select the desired combination of configuration and platform and eventually build the solut

Re: How to gather information about the system hardware?

2008-05-08 Thread Tim Golden
Florencio Cano wrote: Hi, I'm looking for a method of gathering information about the system hardware and software installed using Python. I would like to do it in UNIX and in Windows. I think that it would be good in Windows to look in the registry and be able to parse and search it. Any pointer

Re: Not able to get utf8 encoded string into a document

2008-05-09 Thread Tim Golden
Lawrence, Anna K (US SSA) wrote: I am working on a web application using Pylons .0.9.6, SQLAlchemy 0.4.4, MySQLdb 1.2.2 and Python 2.4.4. We want to use utf8 encoding throughout and as far as I can see everything is set properly between components and I’ve got a sitecustomize.py in my site-pa

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-09 Thread Tim Roberts
id. The shebang line (#!) must specify a full path. When you saw the lone word ("perl"), it was probably a /usr/bin/env line, just we have been discussing. >I at a windows system now so I can't try it yet. *IF* you are interested in playing with Linux, most of the dis

Re: export sites/pages to PDF

2008-08-17 Thread Tim Roberts
7;s on the screen, then I don't think you have any option other than a screen capture utility, like "xwd". -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Don�t find HTMLgen

2008-08-17 Thread Tim Roberts
/Templating> > >Thank a lote. Allow me to second this idea. I used to be a huge HTMLgen fan, and I built several CGI web sites using it, but I am now convinced that a templating solution is better in virtually every case. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use win32com to convert a MS WORD doc to HTML ?

2008-08-19 Thread Tim Golden
Lave wrote: Hi, all ! I'm a totally newbie huh:) I want to convert MS WORD docs to HTML, I found python windows extension win32com can make this. But I can't find the method, and I can't find any document helpful. You have broadly two approaches here, both involving automating Word (ie using

Discrete Simulation

2008-08-19 Thread Tim Roberts
device's FIFO, and a webcam video stream. It was easy to add a bit of randomness to simulate poor conditions, and I got my answer in short order. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging of a long running process under Windows

2008-08-21 Thread Tim Golden
R. Bernstein wrote: I don't know how well Microsoft Windows allows for sending a process a signal in Python, but if the Python signal module works reasonably well on Microsoft Windows, then reread http://bashdb.sourceforge.net/pydb/pydb/lib/node38.html The answer is: not terribly well. (Or, rat

Re: Graphics Contexts and DCs explanations?

2008-08-21 Thread Tim Roberts
ext. Windows requires special handling to create a DC within a WM_PAINT handler (which is what calls OnPaint). That's why wx.PaintDC is separate. Outside of OnPaint, you'd usually use wx.ClientDC. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: evaluating code lines above breakpoints ?

2008-08-21 Thread Tim Roberts
ases information content. Most Python functions do not have a large set of locals(). -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python open of c:\ path Problem

2008-08-23 Thread Tim Golden
Wayne Watson wrote: Python doesn't like this: junkfile = open('c:\tmp\junkpythonfile','w') I get junkfile = open('c:\tmp\junkpythonfile','w') IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile' The clue, if you needed one, is there in that traceback. Notice the *single

ctypes - loading 'librsvg-2-2.dll'

2008-08-26 Thread Tim Grove
ame, mode) WindowsError: [Error 127] The specified procedure could not be found Best regards, Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Launch an application and continue the script's execution

2008-08-27 Thread Tim Golden
Gabriel Genellina wrote: Start the application in a separate console (using `start "" bat_file` might be the easiest way) and then, within your Python script, wait until the new process is ready. The wmi module by Tim Golden can help <http://tgolden.sc.sabren.com/python/wmi.htm

Re: Date type in win32com?

2008-08-27 Thread Tim Golden
Haeyoung Kim wrote: Hi. I'm migrating a VBScript into python. How should I convert Date type parameter in VBScript's COM interface with win32com? I couldn't find any answer yet... Could you give an example of code you're trying to translate? Normally it's quite simple, but different subsyste

Re: Getting references to obect instances into a list

2008-08-27 Thread Tim Golden
Marc 'BlackJack' Rintsch wrote: On Wed, 27 Aug 2008 08:32:52 -0700, [EMAIL PROTECTED] wrote: Thanks for your reply Simon. I will read the article you told me to but first, please, have a look at this snippet: [... snipped snippet plus Mark's comment ...] I think, in short, the best thing fo

Re: struct.Struct random access

2008-08-28 Thread Tim Roberts
ving anything. >Even in sequential access speed benefits, by avoiding the construction >of n-1 objects. This is a fairly major change, because it requires a "struct.Struct" object to maintain state, something that the "struct" module currently does not do. In my personal opinion, this is a rather large and confusing change, for very little benefit. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: calling NetShareEnum win32api with ctypes

2008-08-28 Thread Tim Golden
taghi wrote: I want to call NetShareEnum, a function from netapi32.dll Not a straightforward answer but... are you aware that this particular call is already wrapped by the pywin32 packages: https://sourceforge.net/projects/pywin32/ http://timgolden.me.uk/pywin32-docs/win32net__NetShareEnum_m

Re: I/O error 13 Permission denied -Cannot access file as it is used by another process.

2008-08-28 Thread Tim Golden
aditya shukla wrote: Hello folks, I am creating a python script[windows vista and python2.5] which accesses another program(prog2).I my python script i am creating a temporary file and i write the output of prog2 in this temporary file. temp = tempfile.NamedTemporaryFile(suffix='_suffix',pr

Re: calling NetShareEnum win32api with ctypes

2008-08-28 Thread Tim Golden
taghi wrote: I wrote this code in python 2.5: from ctypes import * ... snip ... netapi32=cdll.LoadLibrary('netapi32.dll') This is your problem: netapi32 is a windows DLL and needs to be attached as such: netapi32 = windll.LoadLibrary ("netapi32.dll") or, more simply: netapi32 = win

Re: calling NetShareEnum win32api with ctypes

2008-08-28 Thread Tim Golden
taghi wrote: I wrote this code in python 2.5: from ctypes import * ... snip ... netapi32=cdll.LoadLibrary('netapi32.dll') This is your problem: netapi32 is a windows DLL and needs to be attached as such: netapi32 = windll.LoadLibrary ("netapi32.dll") or, more simply: netapi32 = win

Re: Descriptor leak in python 2.4 subprocess module

2008-08-28 Thread Tim Golden
Michel Lespinasse wrote: Hi, I hit an issue with the following python code: try: get_orient = subprocess.Popen (['jpegexiforient', '-n', pathfull], stdin = subprocess.PIPE, stdout = subprocess.PIPE)

Re: Multiple values for one key

2008-08-28 Thread Tim Rowe
ot;999 over there","zip":"5"}, > ] I think I'd make a class with members name, address, zip, etc. Then make a list of instances of that class or (better for access) identify a primary key -- what *is* unique about each entry -- and use that as a dictionary key with class instances as values. Or use a DBMS. Certainly the original poster should read up on database design, or chances are he'll have a nightmare maintaining referential integrity. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest way to write huge files

2008-08-29 Thread Tim Golden
Terry Reedy wrote: Mohamed Yousef wrote: let's say , I'm moving large files through network between devices what is the fastest way to do this ? what i came up with :- Use your OS's network copy command. On unix, that was once uucp. On Windows, I drag-and-drop to/from a Network Neighborho

Re: microsoft terminal server

2008-08-29 Thread Tim Golden
[EMAIL PROTECTED] wrote: HI, i would like to know if there is a way to create a python script for automate mstsc.exe username and pwd credential, i mean i would create a script that first open mstsc.exe and in the same time is able to fill [computer+username+pwd]. Haven't tried it, but in princ

Re: translating "create Semaphore" to Linux

2008-08-29 Thread Tim Golden
GHUM wrote: hSem = win32event.CreateSemaphore (None, 1, 1,"stringincludinginterfaceandport") rt=win32event.WaitForSingleObject (hSem, 0) if rt != win32event.WAIT_TIMEOUT: really_do_start_my_app() else: print "application allready running" to make sure that only ONE instance of the applicat

Re: translating "create Semaphore" to Linux

2008-08-29 Thread Tim Golden
GHUM wrote: Tim, ... why use a Semaphore rather than a Mutex? as much as I understood the documentation at MSDN http://msdn.microsoft.com/en-us/library/ms686927(VS.85).aspx http://msdn.microsoft.com/en-us/library/ms686946(VS.85).aspx a mutex seems to be nothing else than a special case of

Re: struct.Struct random access

2008-08-29 Thread Tim Roberts
ou were proposing them as new additions. Because of that, the rest of my post doesn't make much sense. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0b2 cannot map '\u12b'

2008-08-31 Thread Tim Roberts
ue, or am I doing something wrong? Both. U+012B is the Latin lower-case i with macron (i with a bar instead of a dot). That character does not exist in the 8-bit character set CP437, which you are trying to use. If you choose an 8-bit character set that includes i-with-macron, then it will work. UTF-8 would be a good choice. It's in ISO-8859-10. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing "&A" in a string..

2008-08-31 Thread Tim Roberts
x in the general case, because your page might already contain "&". If it is possible that some of them might be wrong while some are right, you can do something like: s = s.replace( '&', '&' ).replace( '&', '&' ) -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV reader and unique ids

2008-09-01 Thread Tim Golden
Mike P wrote: I'm trying to use the CSV module to read in some data and then use a hashable method (as there are millions of records) to find unique ids and push these out to another file, You could either zip with a counter or use the uuid module, depending on just how unique you want your ids

Re: [ctypes-users] ctypes - loading 'librsvg-2-2.dll'

2008-09-02 Thread Tim Grove
aths "seem" to be okay, but there must still be something that I'm missing. Tim Martin (gzlist) wrote: On 26/08/2008, Tim Grove <[EMAIL PROTECTED]> wrote: Any ideas why a particular dll won't load on Windows XP Pro using ctypes? I'm going to take

<    54   55   56   57   58   59   60   61   62   63   >