Running script in background.

2005-04-30 Thread Harlin Seritt
Hi, I have a script.py that is converted to .exe using py2exe. From another script I call script.exe and would like to be able to run this script.exe in the background (as well as in console -- giving the user some simple options). How can I make this happen? thanks, Harlin -- http://mail.pyth

Re: Tkinter weirdness item count

2005-04-30 Thread Peter Otten
phil wrote: > def __del__(s): > line.count = line.count - 1 > > ## delete the line object if the > ## class instance is deleted > s.glob.can.delete(s.obj) > > > After the rotation I check line.count and it is 3 Did you know that exceptions are ignored in the __del__() method? One way to verify

Re: Interrupting execution of PyRun_SimpleScript()

2005-04-30 Thread Andrew Dalke
A few days ago stephan wrote: > Im am using PyRun_SimpleString() inside a BCB 5.0 GUI app > on win32. Never used it so can only offer a suggestion. > For this I have a button called "stop", and when > the user executes it, I generate an exeption by > calling: > PyRun_SimpleString("raise Keyboard

Re: pstats: negative time values

2005-04-30 Thread Andrew Dalke
A few days ago Tom Mortimer wrote: > A quick question - can anyone tell me how to interpret negative time > values in pstats.Stats.print_stats() output? See http://docs.python.org/lib/profile-limits.html After the profiler is calibrated, it will be more accurate (in a least square sense), but

Re: ANN: pynetwork 2.25

2005-04-30 Thread [EMAIL PROTECTED]
I can't understand why name a graph library 'nework' :) -- http://mail.python.org/mailman/listinfo/python-list

Re: compare two voices

2005-04-30 Thread Qiangning Hong
Jeremy Bowers wrote: > No matter how you slice it, this is not a Python problem, this is an > intense voice recognition algorithm problem that would make a good > PhD thesis. No, my goal is nothing relative to voice recognition. Sorry that I haven't described my question clearly. We are not teac

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-30 Thread Dan Bishop
Dan Bishop wrote: > Shane Hathaway wrote: > > pythonchallenge wrote: > > > For the riddles' lovers among you, you are most invited to take > part > > > in the Python Challenge, the first python programming riddle on the > net. > > > > > > You are invited to take part in it at: > > > http://www.pyth

Re: ANN: pynetwork 2.25

2005-04-30 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Pynetwork is a graph library, my first SourceForge project: > > http://sourceforge.net/projects/pynetwork/ > > It included tests, some demo, some premilinary docs, and some images. > You can see some screenshoots on the SourceForge page for them. > I know about 5-6 other

Re: compare two voices

2005-04-30 Thread Jeremy Bowers
On Sat, 30 Apr 2005 20:00:57 -0700, Qiangning Hong wrote: > I want to make an app to help students study foreign language. I want the > following function in it: > > The student reads a piece of text to the microphone. The software records > it and compares it to the wave-file pre-recorded by th

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-30 Thread Dan Bishop
Shane Hathaway wrote: > pythonchallenge wrote: > > For the riddles' lovers among you, you are most invited to take part > > in the Python Challenge, the first python programming riddle on the net. > > > > You are invited to take part in it at: > > http://www.pythonchallenge.com > > That was pretty

Re: Best way to parse file into db-type layout?

2005-04-30 Thread Steve Holden
John Machin wrote: On Sat, 30 Apr 2005 09:23:16 -0400, Steve Holden <[EMAIL PROTECTED]> wrote: John Machin wrote: [...] I wouldn't use fileinput for a "commercial data processing" exercise, because it's slow, and (if it involved using the Python csv module) it opens the files in text mode, and bec

compare two voices

2005-04-30 Thread Qiangning Hong
I want to make an app to help students study foreign language. I want the following function in it: The student reads a piece of text to the microphone. The software records it and compares it to the wave-file pre-recorded by the teacher, and gives out a score to indicate the similarity between t

Re: Trying to write CGI script with python...

2005-04-30 Thread Steve Holden
Jason Mobarak wrote: M.E.Farmer wrote: I found an excellent example that was posted by the F-bot. [...] try: import myscript myscript.main() except: print "Content-Type:", "text/html" print file = StringIO.StringIO() Note: it's usually a very bad idea to name -anything- "file" unles

Re: How to track down all required shared libraries?

2005-04-30 Thread Jeff Epler
One poster suggests 'ldd' for executables. You can also use this on shared libraries: $ ldd /usr/lib/python2.3/lib-dynload/_tkinter.so libtix8.1.8.4.so => /usr/lib/libtix8.1.8.4.so (0x009b6000) libtk8.4.so => /usr/lib/libtk8.4.so (0x00111000) libtcl8.4.so => /usr/lib/libtc

Re: How to track down all required shared libraries?

2005-04-30 Thread Mike Rovner
sdhyok wrote: Recently, I installed many shared libraries to run a program written in Python. Now, I am in the situation to run the same program but on several different machines with the same Linux OS. To avoid the reinstallation, I like to pack up all shared libraries into a directory. Is there a

Re: Ron Grossi: God is not a man

2005-04-30 Thread Mike brown
Just go away from RMMGA -- http://mail.python.org/mailman/listinfo/python-list

Re: Ron Grossi: God is not a man

2005-04-30 Thread Nolan Caudill
Donald L McDaniel wrote: AKA wrote: "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] MC05 wrote: "sheltech" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] "MC05" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] "Donald L McDaniel" <[EMAIL PROTE

Tkinter weirdness item count

2005-04-30 Thread phil
>> Using Tkinter Canvas to teach High School Geometry >> with A LOT of success. >Can you post a link to your code. >I'd like to see what you are doing. >Thx, >Alan Isaac Yes, I will release it open source at the end of may. There are too many features I want to add to release it now. Essentially it

Re: Trying to write CGI script with python...

2005-04-30 Thread Jason Mobarak
M.E.Farmer wrote: > I found an excellent example that was posted by the F-bot. [...] > try: > import myscript > myscript.main() > except: > print "Content-Type:", "text/html" > print > file = StringIO.StringIO() Note: it's usually a very bad idea to name -anything- "file" unles

Re: Best way to parse file into db-type layout?

2005-04-30 Thread John Machin
On Sat, 30 Apr 2005 14:31:08 +0100, Michael Hoffman <[EMAIL PROTECTED]> wrote: >John Machin wrote: > >That's nice. Well I agree with you, if the OP is concerned about embedded >CRs, LFs and ^Zs in his data (and he is using Windows in the latter case), >then he *definitely* shouldn't us

Re: Best way to parse file into db-type layout?

2005-04-30 Thread John Machin
On Sat, 30 Apr 2005 09:23:16 -0400, Steve Holden <[EMAIL PROTECTED]> wrote: >John Machin wrote: >[...] >> >> I wouldn't use fileinput for a "commercial data processing" exercise, >> because it's slow, and (if it involved using the Python csv module) it >> opens the files in text mode, and because

ANN: pynetwork 2.25

2005-04-30 Thread bearophileHUGS
Pynetwork is a graph library, my first SourceForge project: http://sourceforge.net/projects/pynetwork/ It included tests, some demo, some premilinary docs, and some images. You can see some screenshoots on the SourceForge page for them. I know about 5-6 other graph libraries for Python, one even

Re: Ron Grossi: God is not a man

2005-04-30 Thread Anthra Norell
It must be because there aren't enough real problems that so many people devote so much energy to inventing so many imaginary ones. Frederic (GOD tells me---much against my will; I categorically refuse to be a prophet!---to throw this piece of HIS divine wisdom into the melee.) - Original

Re: Numeric/Numarray equivalent to zip ?

2005-04-30 Thread Robert Kern
George Sakkis wrote: What's the fastest and most elegant equivalent of zip() in Numeric/Numarray between two equally sized 1D arrays ? That is, how to combine two (N,)-shaped arrays to one (N,2) (or (2,N)) shaped ? I expect the fastest and the most elegant idiom to be identical, as it is usually th

Re: bytecode non-backcompatibility

2005-04-30 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: > So if C extension API (or whatever that is really called) is stable, > the system admin can just copy all of /sw/lib/python2.3/site-packages > into /sw/lib/python2.4/site-packages and it should work. From what > you've said, it seems that this isn't possib

Re: array type casting problem in scipy.interpolate

2005-04-30 Thread Alex
On 30 Apr 2005 12:32:31 -0700, bgs <[EMAIL PROTECTED]> said: > The routine requires real arrays, and you are giving it one complex > one. It does not know what to do with the complex array. What are you > expecting it to do? If you need the real and imaginary parts to be > separately interpolate

Re: bytecode non-backcompatibility

2005-04-30 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: >>>Python can then have a built-in mechanism to read the description file >>>and download the source codes and do the standard "sudo python >>>setup.py install" to install the library into site-package. >> I don't like this - it would make Python depend on

How to track down all required shared libraries?

2005-04-30 Thread sdhyok
Recently, I installed many shared libraries to run a program written in Python. Now, I am in the situation to run the same program but on several different machines with the same Linux OS. To avoid the reinstallation, I like to pack up all shared libraries into a directory. Is there a good way to t

Re: Can .py be complied?

2005-04-30 Thread Mike Meyer
jfj <[EMAIL PROTECTED]> writes: > /* small program in C in self extracting archive > */ > if (have_application ("Python")) { >have_python: >system ("python.exe my_application.py") > } else { >printf ("This software requires python. Wait until all the > necessary components are being

Re: Data smoothing algorithms? - Thank you all

2005-04-30 Thread Anthra Norell
Thank you all for your solutions! The moving average filter will surely do. I will take a closer look at SciPy, though. The doc is impressive. I believe it's curve fitting I am looking for rather than interpolation. There's a chapter on that too. Frederic - Original Message - From: "Larr

Tripoli: a Python-based triplespace implementation

2005-04-30 Thread Dominic Fox
I have been working on a Python implementation of a modified Tuple Space (cf Linda, JavaSpaces) that contains only 3-tuples (triples), and that has operators for copying and moving graphs of triples as well as sets matching a given pattern. It's called Tripoli, and the code for it can be found here

Re: [newbie] Embedding Flash OCX object

2005-04-30 Thread Zoool
Thanks Kartic, Don't know if i have understand everything, but i 'll try using your lights, To integrate a flash movie using wx, here is a piece of code (the Flash.py is auto-generated by makepy.py) ### testFlash.py from wxPython.wx import * import os if wxPlatform == '__WXMSW__': from

Re: Ron Grossi: God is not a man

2005-04-30 Thread radio913
Johnny Gentile wrote: > C'mon. Everyone knows God plays a Martin. But He also has a de Jonge or two... Also, i've heard that Satan plays an old, beat up Takamine it's NEVER in tune, the action is ultra-high, and it buzzes like mad. Slick -- http://mail.python.org/mailman/list

Re: Ron Grossi: God is not a man

2005-04-30 Thread Johnny Gentile
>From the Book of Armaments: "And Saint Attila raised the hand grenade up on high, saying, 'Oh, Lord, bless this thy hand grenade that with it thou mayest blow thy enemies to tiny bits, in thy mercy.' And the Lord did grin, and people did feast upon the lambs, and sloths, and carp, and anchovies,

Re: Micro-PEP: str.translate(None) to mean identity translation

2005-04-30 Thread Bengt Richter
On Sat, 30 Apr 2005 08:44:21 GMT, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: >[Bengt Richter] >> Just thought None as the first argument would be both handy and mnemonic, >> signifying no translation, but allowing easy expression of deleting >characters, >> e.g., >> >>s = s.translate(None,

Re: Ron Grossi: God is not a man

2005-04-30 Thread Obaid R.
Non-Offensive, Professional Sounding Name First of all, there was no "diatribe", even when you can claim there was one. Unless of course you consider the contents of the Bible from which I quote as such. Seeing that you claimed that there was no truth in my post, I was hoping to read proof in sup

Re: Ron Grossi: God is not a man

2005-04-30 Thread Obaid R.
Larry Bates, I truly appreciate the dignified tone of your response. Kindly allow me to respond. IN SPITE OF THE BIBLE, NOT BECAUSE OF IT? = First I do apologize for the earlier long discourse; I am afraid this might be just as long. There is much to d

Re: Directory in Windows

2005-04-30 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, custard_pie wrote: > Here's my code > > filelist={} > def listFiles(self, dirName, filesInDir): > for fname in filesInDir: > if os.path.isfile(fname): `fname` contains just the file name without t

Re: [newbie] Embedding Flash OCX object

2005-04-30 Thread Kartic
The Great 'Exeem' uttered these words on 4/30/2005 11:37 AM: Kartic, Thanks for your reply, I already use the wxPython to embbed my flash animation ### from wxPython.lib.activexwrapper import MakeActiveXClass ActiveXWrapper = MakeActiveXClass(flashActiveXLib.ShockwaveFlash, eventClass=None, eventO

Re: Ron Grossi: God is not a man

2005-04-30 Thread Obaid R.
Donald L McDaniel wrote: > 1) I am posting to a newsgroup on the Microsoft Usenet Server. It's not my > fault the demon-lover who posted the original anti-Christian article > cross-posted to so many newsgroups across so many servers. Talk to him > about cross-posting. > 1) I will go away, when C

Re: array type casting problem in scipy.interpolate

2005-04-30 Thread bgs
The routine requires real arrays, and you are giving it one complex one. It does not know what to do with the complex array. What are you expecting it to do? If you need the real and imaginary parts to be separately interpolated, then split the complex array into two real arrays and use the rout

Re: [Py Windows] User Directory Path

2005-04-30 Thread Wolfgang Strobl
"Zoool" : >Is there a way to know the main directory path of a user session? >I mean the "C:\Documents and Settings\username" Directory of the user logged >into a windows session. >>> from win32com.shell.shell import SHGetSpecialFolderPath >>> from win32com.shell.shellcon import CSIDL_PROFILE >>

Re: tkinter OptionMenu column break

2005-04-30 Thread Jeff Epler
I don't think that Tk's menus ever use more than one column. They certainly don't on Unix. Jeff pgpsVnvjgm3Qy.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: User Directory Path

2005-04-30 Thread Zoool
Thanks a lot, os.environ["HOMEDRIVE"] os.environ["HOMEPATH"] are what i was looking for "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > os.getenv or os.envoron, see http://docs.python.org/lib/os-procinfo.html > -- http://mail.python.org/m

Re: User Directory Path

2005-04-30 Thread [EMAIL PROTECTED]
os.getenv or os.envoron, see http://docs.python.org/lib/os-procinfo.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Directory in Windows

2005-04-30 Thread custard_pie
Here's my code filelist={} def listFiles(self, dirName, filesInDir): for fname in filesInDir: if os.path.isfile(fname): key = os.path.join(dirName, fname) stats = os.stat

Re: Writing to log file when script is killed

2005-04-30 Thread Heiko Wundram
Am Samstag, 30. April 2005 14:26 schrieb [EMAIL PROTECTED]: > If you run on unix you can use the signal module to intercept a kill - > see http://docs.python.org/lib/node368.html for a quick example You cannot intercept a kill (that's the whole meaning of SIGKILL, rather than SIGTERM)... Read up

Re: Directory in Windows

2005-04-30 Thread Kent Johnson
custard_pie wrote: Hi,..I tried to list files in a tree directory using os.path.walk. To avoid dirnames fromm being listed i use the os.path.isdir method. However, when isdir encounters directories that use spaces in their name e.q My Documents it doesn;t recognize them as directories.. Is there an

[Py Windows] User Directory Path

2005-04-30 Thread Zoool
Hi, Is there a way to know the main directory path of a user session? I mean the "C:\Documents and Settings\username" Directory of the user logged into a windows session. In .NET you can do this with a : System.Environment.GetEnvironmentVariable("HOMEDRIVE") System.Environment.GetEnvironmentVaria

Re: large dictionary creation takes a LOT of time.

2005-04-30 Thread Kent Johnson
Maksim Kasimov wrote: sorry for my question, but i've read the documentation, and can't find where is the explanation of how it is exactly works (but of course i do believe you). If it is buit in function, can i see the source code of the method to find it out? Kent Johnson wrote: http://docs.p

Directory in Windows

2005-04-30 Thread custard_pie
Hi,..I tried to list files in a tree directory using os.path.walk. To avoid dirnames fromm being listed i use the os.path.isdir method. However, when isdir encounters directories that use spaces in their name e.q My Documents it doesn;t recognize them as directories.. Is there any solution to this,

Re: Micro-PEP: str.translate(None) to mean identity translation

2005-04-30 Thread M.E.Farmer
After I re-read your post in daylight and read your followup the "Aha!" hit me .I am a little slow at times. I have always just iterated thru the badchars and replaced with "" . What you suggest would be very nice indeed! Thanks for the time and explanation, and you too Peter ! For what it is wo

lists in cx_Oracle

2005-04-30 Thread Andrew Dalke
A while back I asked about which Oracle client to use for MS Windows. Turns out I also needed one for unix so I followed people's advice and installed cx_Oracle. I want to execute a query with an "IN" in the WHERE clause and with the parameter taken from a Python variable. That is, I wanted some

Re: interactive web graphics

2005-04-30 Thread M.E.Farmer
Blender has nothing to do with Mozilla. It is a 3d creation suite it contains more things than you would believe ;) Blender is deep and wide, so it can be daunting to use at first but once you have basic 3d concepts under you belt it is playtime. Blender is the first software package to be bought f

Re: New Python website

2005-04-30 Thread Kay Schluehr
lpe wrote: > http://www.pycode.com > > I was kinda suprised when I could not find any good sites with 3rd > party modules (other than the Vaults of Parnassus, where you must host > files elsewhere), so I decided to write one myself :) Maybe You shot a bit fast? PiPy is good and the Vaults are goo

Re: mbx repair script: Python vs perl

2005-04-30 Thread Donn Cave
Quoth "David Isaac" <[EMAIL PROTECTED]>: | I'm looking for the Python equivalent of the perl script and module | described at | http://comments.gmane.org/gmane.mail.imap.uw.c-client/707 | | Any hope? Sure, should be doable, if for some reason you can't just use that. I personally wouldn't do it ex

Re: Ron Grossi: God is not a man

2005-04-30 Thread Donald L McDaniel
Johnny Gentile wrote: > Donald - go away. Far away. Now. > And, for the last time (hopefully), stop crossposting to > rec.music.beatles. > Go sell crazy somewhere else. We're all stocked up. > > Donald L McDaniel wrote: >> AKA wrote: >>> "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message >>>

Re: Can .py be complied?

2005-04-30 Thread Peter Dembinski
[EMAIL PROTECTED] (John J. Lee) writes: [snap] > Until they install the next program that does this. If we talk about _real_ users from the _real_ world, the most of them would just kill the app (or what is the name for stopping running program in w32) when the download begins[1] :) [1] 'hey, i

Re: [newbie] Embedding Flash OCX object

2005-04-30 Thread Exeem
Kartic, Thanks for your reply, I already use the wxPython to embbed my flash animation ### from wxPython.lib.activexwrapper import MakeActiveXClass ActiveXWrapper = MakeActiveXClass(flashActiveXLib.ShockwaveFlash, eventClass=None, eventObj=self) Flash = ActiveXWrapper( self, -1, style=wxSUNK

mbx repair script: Python vs perl

2005-04-30 Thread David Isaac
I'm looking for the Python equivalent of the perl script and module described at http://comments.gmane.org/gmane.mail.imap.uw.c-client/707 Any hope? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: large dictionary creation takes a LOT of time.

2005-04-30 Thread Maksim Kasimov
sorry for my question, but i've read the documentation, and can't find where is the explanation of how it is exactly works (but of course i do believe you). If it is buit in function, can i see the source code of the method to find it out? Kent Johnson wrote: Maksim Kasimov wrote: Kent Johnson w

Re: Tkinter app=App(root) problem

2005-04-30 Thread Steve Holden
[EMAIL PROTECTED] wrote: This is my first day working with Tkinter. I'm using python2.3 on WindowsXP. I found this program and entered it. from Tkinter import * class App: def _init_(self,master): ^^ This should be __init__ (the underscores should be doubled). Python "magic meth

Re: Fwd: how to find the drive in python/cygwin?

2005-04-30 Thread Jason Tishler
Ivan, On Sat, Apr 30, 2005 at 08:44:55AM -0600, Ivan Van Laningham wrote: > Jason Tishler wrote: > > I was just clarifying that the win32api module is not supported > > under Cygwin Python. > > Could you clarify? I always thought that the only thing really > different were the default path assum

Re: Killing process

2005-04-30 Thread Peter Hansen
Harlin Seritt wrote: I think I need something besides TerminateProcess(). Is there anyway possible to terminate a process by just passing a string value to the function? Honestly, I am not interesting in terminating a process by its handle. This is a bizarre request. Why can't you just call int()

Re: Fwd: how to find the drive in python/cygwin?

2005-04-30 Thread Ivan Van Laningham
Hi All-- Jason Tishler wrote: > > Ivan, > > It depends on your needs. If you are looking for a more Unix-like > Python, then the Cygwin version would probably be better. If > Windows-like, then the native Windows version would probably be better. > > The OP seem to be interested in a Cygwin P

Re: [newbie] Embedding Flash OCX object

2005-04-30 Thread Kartic
The Great 'Exeem' uttered these words on 4/29/2005 2:11 PM: Hi All, I'm trying to find a way to embbed the flash.ocx object in a Windows Python application, I've successfully integrated a flash object with the ocx already installed on the system using the Activex Wrapper, but i would like to embb

Re: Fwd: how to find the drive in python/cygwin?

2005-04-30 Thread Jason Tishler
Ivan, On Sat, Apr 30, 2005 at 07:29:32AM -0600, Ivan Van Laningham wrote: > Jason Tishler wrote: > > On Tue, Apr 26, 2005 at 07:02:48PM -0600, Ivan Van Laningham wrote: > > > Use win32api to find drives: > > > > > > cut here > > > #!/usr/bin/python > > > # -*- coding: utf-8 -*- > > > > > >

Re: date to digit

2005-04-30 Thread Fabio Pliger
"Sara Khalatbari" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Is there a program in python that inputs a date & a > time, for example: "2005-04-17 04:20+". And > returns a digit, for example: "3501" instead? > > and if there is such program or built-in function, how

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-30 Thread Roel Schroeven
Mike Rovner wrote: David Murmann wrote: Shane Hathaway wrote: That was pretty fun. Good for a Friday. Too bad it comes to an abrupt "temporary end". Shane P.S. I hope I didn't hammer your server on step 3. I was missing the mark. :-) Interestingly step 3 is actually wrong... there is an additi

Tkinter app=App(root) problem

2005-04-30 Thread snoylr
This is my first day working with Tkinter. I'm using python2.3 on WindowsXP. I found this program and entered it. from Tkinter import * class App: def _init_(self,master): frame = Frame(master) frame.pack() self.button = Button(frame, text = "Quit", fg = "red", comma

Re: interactive web graphics

2005-04-30 Thread Diez B. Roggisch
> > I'm surprised that Trolltech is allowing Microsoft to get their product > for free. If the free version is used, it's license is GPL. So for commercial apps, you still need a license (for linux as well) > I have played with Qt3 somewhat; not sure how their widgetry > compares with GTK+, as

Re: Best way to parse file into db-type layout?

2005-04-30 Thread Michael Hoffman
John Machin wrote: That's nice. Well I agree with you, if the OP is concerned about embedded CRs, LFs and ^Zs in his data (and he is using Windows in the latter case), then he *definitely* shouldn't use fileinput. And if the OP is naive enough not to be concerned, then it's OK, is it? It simply isn

Re: Can .py be complied?

2005-04-30 Thread Steve Holden
John J. Lee wrote: Steve Holden <[EMAIL PROTECTED]> writes: [...] There's nothing wrong with open source projects catering to a market, and there's nothing wrong with running open source software on a proprietary operating system. To behave otherwise might reduce the growth opportunities for Python

Re: Fwd: how to find the drive in python/cygwin?

2005-04-30 Thread Ivan Van Laningham
Hi All-- Jason Tishler wrote: > > Ivan, > > On Tue, Apr 26, 2005 at 07:02:48PM -0600, Ivan Van Laningham wrote: > > Use win32api to find drives: > > > > cut here > > #!/usr/bin/python > > # -*- coding: utf-8 -*- > > > > import os > > import os.path > > import win32api > > [snip] > > AFA

Re: Fwd: how to find the drive in python/cygwin?

2005-04-30 Thread Jason Tishler
Ivan, On Tue, Apr 26, 2005 at 07:02:48PM -0600, Ivan Van Laningham wrote: > Use win32api to find drives: > > cut here > #!/usr/bin/python > # -*- coding: utf-8 -*- > > import os > import os.path > import win32api > [snip] AFAICT, the win32api module has not been ported to Cygwin Python.

Re: Best way to parse file into db-type layout?

2005-04-30 Thread Steve Holden
John Machin wrote: [...] I wouldn't use fileinput for a "commercial data processing" exercise, because it's slow, and (if it involved using the Python csv module) it opens the files in text mode, and because in such exercises I don't often need to process multiple files as though they were one file

Re: how can I sort a bunch of lists over multiple fields?

2005-04-30 Thread El Pitonero
googleboy wrote: > > I am reading in a csv file that documents a bunch of different info on > about 200 books, such as title, author, publisher, isbn, date and > several other bits of info too. > ... > I really want to be able to sort the list of books based on other > criterium, and even multiple

Re: Writing to log file when script is killed

2005-04-30 Thread [EMAIL PROTECTED]
If you run on unix you can use the signal module to intercept a kill - see http://docs.python.org/lib/node368.html for a quick example -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to parse file into db-type layout?

2005-04-30 Thread John Machin
On Sat, 30 Apr 2005 11:35:05 +0100, Michael Hoffman <[EMAIL PROTECTED]> wrote: >John Machin wrote: >> Real-world data is not "text". > >A lot of real-world data is. For example, almost all of the data I deal with >is text. OK, depends on one's definitions of "data" and "text". In the domain of c

Re: Library Naming Conventions.

2005-04-30 Thread [EMAIL PROTECTED]
see http://www.python.org/peps/pep-0008.html for naming conventions and other style issues -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run a program?

2005-04-30 Thread [EMAIL PROTECTED]
please read the documentation for subprocess, http://docs.python.org/lib/node230.html -- http://mail.python.org/mailman/listinfo/python-list

Re: date to digit

2005-04-30 Thread [EMAIL PROTECTED]
try time.strptime() , and then time.time() - see documentation (http://docs.python.org/lib/module-time.html) -- http://mail.python.org/mailman/listinfo/python-list

date to digit

2005-04-30 Thread Sara Khalatbari
Is there a program in python that inputs a date & a time, for example: “2005-04-17 04:20+”. And returns a digit, for example: “3501” instead? and if there is such program or built-in function, how can I run it inside a code? __ Do You Yahoo!?

Re: Best way to parse file into db-type layout?

2005-04-30 Thread Michael Hoffman
John Machin wrote: I beg your pardon. How does: "Your point addresses the letter rather than the spirit of the 'law'" sound? Sure, thanks. Real-world data is not "text". A lot of real-world data is. For example, almost all of the data I deal with is text. That's nice. Well I agree with you, if the

How to run a program?

2005-04-30 Thread Sara Khalatbari
I'm writing a code that checks the header of .po file for syntax errors. I want this program to run msgfmt.py on the .po file first & then the rest. How can you write a code that runs another program in itself? :), Sara __ Do You Yahoo!? Tired of s

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-30 Thread Dan Bishop
darren kirby wrote: > quoth the Shane Hathaway: > > pythonchallenge wrote: > > > For the riddles' lovers among you, you are most invited to take part > > > in the Python Challenge, the first python programming riddle on the net. > > > > > > You are invited to take part in it at: > > > http://www.py

Re: Sorting an Edge List

2005-04-30 Thread Bengt Richter
On Fri, 29 Apr 2005 23:37:39 -0400, "Anthony D'Agostino" <[EMAIL PROTECTED]> wrote: >I found my old bubble sort solution: > > >def esort(edges): >while 1: >swaps = 0 >for j in range(len(edges)-2): >if edges[j][1] != edges

Writing to log file when script is killed

2005-04-30 Thread Harlin Seritt
I am looking for a way for my script to write to a log file saying something like this: I was killed at time.asctime() I would like to be able to do this if/when the script is killed by means rather than my own. How in the world would I accomplish this? Thanks, Harlin -- http://mail.python.or

Library Naming Conventions.

2005-04-30 Thread chris . lyon
Is there any specific naming convention as to capitalisation? Cookies versus cgi for example. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-30 Thread Leif K-Brooks
pythonchallenge wrote: For the riddles' lovers among you, you are most invited to take part in the Python Challenge, the first python programming riddle on the net. You are invited to take part in it at: http://www.pythonchallenge.com Very neat, I love things like this. Level 5 is maddening. Keep u

Re: Micro-PEP: str.translate(None) to mean identity translation

2005-04-30 Thread Raymond Hettinger
[Bengt Richter] > Just thought None as the first argument would be both handy and mnemonic, > signifying no translation, but allowing easy expression of deleting characters, > e.g., > >s = s.translate(None, 'badcharshere') Log a feature request on SF and assignment to me. I'll put this in for

Numeric/Numarray equivalent to zip ?

2005-04-30 Thread George Sakkis
What's the fastest and most elegant equivalent of zip() in Numeric/Numarray between two equally sized 1D arrays ? That is, how to combine two (N,)-shaped arrays to one (N,2) (or (2,N)) shaped ? I expect the fastest and the most elegant idiom to be identical, as it is usually the case in this excell

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-30 Thread Mike Rovner
Tim Peters wrote: [Mike Rovner] 3 IS wrong because if you use any not BIG letter after bodyguard on both sides, you get extra 'eCQQmSXK\n' which slow me down for 5 minutes. Get rid of the newlines first. On level 7, I'm not sure whether there's something more to do, or whether I'm looking at a bug

Re: Micro-PEP: str.translate(None) to mean identity translation

2005-04-30 Thread Peter Otten
M.E.Farmer wrote: > Bengt Richter wrote: >> Just thought None as the first argument would be both handy and > mnemonic, >> signifying no translation, but allowing easy expression of deleting > characters, >> e.g., >> >>s = s.translate(None, 'badcharshere') >> >> Regards, >> Bengt Richter > >

Re: [wxPython] Many wxPanel forms in 1 wxFrame

2005-04-30 Thread Fabio Pliger
"CYBER" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Is this possible to create 1 wxFrame and > register more than 1 wxPanel in it. > And select the one you want to show at the moment ? > > I'm trying to implement a multistep wizard under wxPython. > I need to be able to h

Re: Micro-PEP: str.translate(None) to mean identity translation

2005-04-30 Thread Bengt Richter
On 29 Apr 2005 21:27:18 -0700, "M.E.Farmer" <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> Just thought None as the first argument would be both handy and >mnemonic, >> signifying no translation, but allowing easy expression of deleting >characters, >> e.g., >> >>s = s.translate(None, 'ba

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-30 Thread Tim Peters
[Mike Rovner] > 3 IS wrong because if you use any not BIG letter after bodyguard on both > sides, you get extra 'eCQQmSXK\n' which slow me down for 5 minutes. Get rid of the newlines first. On level 7, I'm not sure whether there's something more to do, or whether I'm looking at a bug in how IE di