[ANN] XPN 0.4.5 released

2005-03-12 Thread Nemesis
XPN - X Python Newsreader is a multiplatform newsreader with unicode support. It is written in Python+PyGTK. It has features like scoring/actions, XFace and Face decoding and random taglines. You can find it on: http://xpn.altervista.org/index-en.html http://sf.net/projects/xpn Changes in this

ctypes 0.9.5 released

2005-03-12 Thread Thomas Heller
ctypes 0.9.5 released - Mar 11, 2005 Overview ctypes is an advanced ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call functions exposed from dlls/shared libraries and has extensive facilities to create,

Re: csv module and unicode, when or workaround?

2005-03-12 Thread Max M
Chris wrote: the current csv module cannot handle unicode the docs say, is there any workaround or is unicode support planned for the near future? in most cases support for characters in iso-8859-1(5) would be ok for my purposes but of course full unicode support would be great... It doesn't

Re: Widget geometry ?

2005-03-12 Thread PGMoscatt
Thanks Pierre all working now. Pete Pierre Quentel wrote: PGMoscatt a crit : Hi All, I am trying to create a dialog which will have a number of components but having trouble with the placement of various widgets. For example, in my code below you will see I am trying to insert

Re: csv module and unicode, when or workaround?

2005-03-12 Thread John Machin
Chris wrote: hi, to convert excel files via csv to xml or whatever I frequently use the csv module which is really nice for quick scripts. problem are of course non ascii characters like german umlauts, EURO currency symbol etc. The umlauted characters should not be a problem, they're all in

Re: csv module and unicode, when or workaround?

2005-03-12 Thread Chris
hi, thanks for all replies, I try if I can at least get the work done. I guess my problem mainly was the rather mindflexing (at least for me) coding/decoding of strings... But I guess it would be really helpful to put the UnicodeReader/Writer in the docs thanks a lot chris --

Re: [NGG/98]-Medicationns

2005-03-12 Thread Hinrik Crocker
Hello, Just Visit Our Pharrmacy-By-Mail SHOP and save up to 75%. Va umVi raCi isAm en, Andman li ag al bi yother! P.S. You will be pleasantly surprised with our prrices ;) Have a good day! --

Re: a program to delete duplicate files

2005-03-12 Thread Patrick Useldinger
John Machin wrote: Just look at the efficiency of processing N files of the same size S, where they differ after d bytes: [If they don't differ, d = S] PU: O(Nd) reading time, O(Nd) data comparison time [Actually (N-1)d which is important for small N and large d]. Hashing method: O(NS) reading

[Ann] ctypes 0.9.5 released

2005-03-12 Thread Thomas Heller
ctypes 0.9.5 released - Mar 11, 2005 Overview ctypes is an advanced ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call functions exposed from dlls/shared libraries and has extensive facilities to create,

Re: Python 2.4, distutils, and pure python packages

2005-03-12 Thread Martin v. Löwis
Thomas Heller wrote: It would be for 2.5, anyway, and I have hoped that bdist_wininst would be replaced by bdist_msi then ;-). What are your plans for that? I still hope to write one by for 2.5. One issue is that you cannot have multiple installations of an MSI package. So if you want to support

Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-12 Thread Martin v. Löwis
Vincent Wehren wrote: is there a reason why msiexec iterates through what looks like all (?) files and directories in/under the destination directory? There is massive file I/O going on there (OK, by now you know I didn't de-install 2.4 before trying ;-)) which explains the 100% CPU usage and

Re: shuffle the lines of a large file

2005-03-12 Thread paul koelle
Joerg Schuster wrote: Thanks to all. This thread shows again that Python's best feature is comp.lang.python. from comp.lang import python ;) Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: i18n: looking for expertise

2005-03-12 Thread Martin v. Löwis
klappnase wrote: enc = locale.nl_langinfo(locale.CODESET).lower() Notice that this may fail on systems which don't provide the CODESET information. Recent Linux systems (glibc 6) have it, and so do recent Solaris systems, but if you happen to use an HPUX9 or some such, you find that

Re: About Databases...

2005-03-12 Thread EP
[EMAIL PROTECTED] wrote: Hello NG, Hello! I am still quite a newbie with Python (I intensely use wxPython, anyway). I would like to know what are, in your opinions, the best/faster databases that I could use in Python (and, of course, I should be able to link everything with a

Re: RELEASED Python 2.4.1, release candidate 1

2005-03-12 Thread Tim N. van der Leeuw
Hi Roger, Thanks, I understand it now, I didn't yet receive in the mail any replies to my post on py-dev when I read your post here! That's why it didn't make any sense to me. I didn't yet have a chance to try the workaround given in the bug-report (remove MBCS encoding line). Hope to find time

Re: Safe Local XMLRPC

2005-03-12 Thread Diez B. Roggisch
I've used the default support available by these classes. Thus it will run on a potentially public TCP/IP port. As the application backend allows, among other things, saving files to the local filesystem, this would be a clear security hole in the wild. Restricting it to localhost would be a

Re: Adapting code to multiple platforms

2005-03-12 Thread Patrick Useldinger
Jeffrey Barish wrote: I have a small program that I would like to run on multiple platforms (at least linux and windows). My program calls helper programs that are different depending on the platform. I think I figured out a way to structure my program, but I'm wondering whether my solution is

Re: How to send browser to open a different URL

2005-03-12 Thread Harald Massa
Mike Wimpe [EMAIL PROTECTED] wrote in news:1110628448.532469.117000 @g14g2000cwa.googlegroups.com: http://groups.google.de/groups?hl=delr=c2coff=1threadm= 2c60a528.0309251324.109d4af5%40posting.google.comrnum=5prev=/groups%3Fq%

is there a problem on this simple code

2005-03-12 Thread jrlen balane
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser = serial.Serial() ser.baudrate = 9600 ser.port = 0 ser ser.close() ser.open() command = 67 message_no = 1

Re: How to turn a variable name into a string?

2005-03-12 Thread Scott David Daniels
André Roberge wrote: [EMAIL PROTECTED] wrote: I have a number of variables (environmental variables, actually), most of which will have a value. But some may not have been found by os.environ.get(), so I set those to None. Now, if any of them are None, the app cannot proceed, so I want to test for

bsddb support for berkeley db 4.3?

2005-03-12 Thread janeaustine50
It doesn't seem like the python 2.4(and the recent 2.4.1) support berkeley db 4.3. (4.3 fixes some deadlock bugs I occasionally encounter using 4.2.) bsddb3(at pybsddb.sf.net) already supports 4.3 since last December(but doesn't explicitly support win32 -- see the assert statement in setup.py). I

Re: pre-PEP: Print Without Intervening Space

2005-03-12 Thread Marcin Ciura
Steve Holden wrote: You could think about teaching them the linelist.append(fn(x)) way, which then gives you the choice of .join(linelist) - no gaps \n.join(lienlist) - one item per line .join(linelist) - spaces between items. Sure I will. Next week, when we come to list operations.

Newbie question Tkinter bitmap

2005-03-12 Thread Wim Goffin
Hi, I'm trying to get a bitmap onto a button, but I can't.Can anyone tell me where to look for a solution? The call I use is this one:self.b = Button(toolbar, text="nieuw", bitmap="@/test.xbm", width=20, command=self.print_msg) The message I get is this:Traceback (most recent call last):

Python Tkinter Newbie question

2005-03-12 Thread Wim Goffin
Hi, I'm trying to get a bitmap onto a button, but I can't.Can anyone tell me where to look for a solution? The call I use is this one:self.b = Button(toolbar, text="nieuw", bitmap="@/test.xbm", width=20, command=self.print_msg) The message I get is this:Traceback (most recent call last):

Tkinter Bitmap Newbie question

2005-03-12 Thread Wim Goffin
Hi, I'm trying to get a bitmap onto a button, but I can't.Can anyone tell me where to look for a solution? The call I use is this one:self.b = Button(toolbar, text="nieuw", bitmap="@/test.xbm", width=20, command=self.print_msg) The message I get is this:Traceback (most recent call last):

Re: About Databases...

2005-03-12 Thread Lee Harr
On 2005-03-11, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello NG, I am still quite a newbie with Python (I intensely use wxPython, anyway). I would like to know what are, in your opinions, the best/faster databases that I could use in Python (and, of course, I should be able to link

Re: a program to delete duplicate files

2005-03-12 Thread Scott David Daniels
Patrick Useldinger wrote: Just to explain why I appear to be a lawer: everybody I spoke to about this program told me to use hashes, but nobody has been able to explain why. I found myself 2 possible reasons: 1) it's easier to program: you don't compare several files in parallel, but process

Re: Confused with classmethods

2005-03-12 Thread Jong ruuddotdedotjongatconsunet dot
jfj schreef: Ruud wrote: So far for *how* it works. As to *why* it works like this, I don't know for sure. But my guess is that the reasoning was something as follows: if you define a function (regular or something special like a classmethod) only for an instance of a class, you obviously don't

Re: psycopg authentication

2005-03-12 Thread Lee Harr
On 2005-03-12, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, I'm new to both PostgreSQL and psycopg and I'm trying to connect to my database running on localhost. I have postgres setup to do md5 authentication and this works when using a db admin tool on my local network. For some reason,

Re: head for grouped data - looking for best practice

2005-03-12 Thread Peter Otten
Harald Massa wrote: def getdoublekey(row): return row[0:2] for key, bereich in groupby(eingabe,getdoublekey): print Area:,key for data in bereich: print --data--, data[2:] which indeed leeds to the expected result, while looking less hacky .. on the other hand

Re: Tkinter Bitmap Newbie question

2005-03-12 Thread Diez B. Roggisch
Posting the same question three times is unecessary and is likely to upset people! TclError: error reading bitmap file \test.xbm This is no valid path name - nor is @/test.xbm, at least to my knowledge. What happens if you supply the full path like this: path = C:\\somedir\\test.xbm --

Re: How to send browser to open a different URL

2005-03-12 Thread Mike Wimpe
although a bit more than I bargained for, this does has some good info, in case you are way in the future of this post... love, mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Licensing Python code under the Python license

2005-03-12 Thread Ville Vainio
Daniel == Daniel Keep [EMAIL PROTECTED] writes: Daniel Thanks for the advice. I'll probably go with either the Daniel BSD license, or possibly the LGPL. But I'm leaning Daniel towards the BSD since it fits on the screen... Isn't MIT license even shorter and simpler? A while ago

Re: Wishlist item: itertools.flatten

2005-03-12 Thread Ville Vainio
Michael == Michael Spencer [EMAIL PROTECTED] writes: Michael Here's a non-recursive implementation. Thanks. Michael There are lots around. Yet another fact that suggest the inclusion in stdlib would make sense ;-). -- Ville Vainio http://tinyurl.com/2prnb --

Re: Python Tkinter Newbie question

2005-03-12 Thread Harlin Seritt
You have: =@/test.xbm take the '/' out or (if it is in a different dir which i think it is), do =/@test.xbm also... make sure your *.xbm is really a bitmap file (that would just be another thing to check... not to say its not the proper format)... Regards, Harlin Seritt --

Re: Licensing Python code under the Python license

2005-03-12 Thread Harlin Seritt
If this is for making money, make it either a proprietary license or BSD. If you're giving it away and expect nothing for it except maybe fame, do GPL. :-) Regards, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Licensing Python code under the Python license

2005-03-12 Thread Harlin Seritt
When you ask an opinion, you can expect a long thread list... even if it's something inane like What kind of license should I use?... hacker/geeks/freaks/wannabes are only too happy to issue an opinion -- warranted or otherwise... Regards, Harlin Seritt --

Re: Python Tkinter Newbie question

2005-03-12 Thread Harlin Seritt
Try not to triple post if you can help it (I'll assume you accidentally hit the SENT button three times whistles) Regards, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a problem on this simple code

2005-03-12 Thread Harlin Seritt
hah, this code is anything but simple... -- http://mail.python.org/mailman/listinfo/python-list

Re: a program to delete duplicate files

2005-03-12 Thread François Pinard
[Patrick Useldinger] Shouldn't you add the additional comparison time that has to be done after hash calculation? Hashes do not give 100% guarantee. If there's a large number of identical hashes, you'd still need to read all of these files to make sure. Identical hashes for different files?

PythonWin

2005-03-12 Thread tkpmep
I have a Python program that collects user input using msg = Enter the full path and name of the file to be processed: answer = raw_input(msg) If I run it in IDLE, the question is splashed across the execution window, and if it is long, simply wraps to the next line. Most importantly, it is

Re: a RegEx puzzle (end of thread)

2005-03-12 Thread Charles Hartman
Won't extend this except to say thanks to Michael Spencer for another version. If I were doing it only once I'd use that. Since I do it more than once I should package it as a function. Thanks. Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/cohar

Re: Licensing Python code under the Python license

2005-03-12 Thread Martin v. Löwis
Ville Vainio wrote: Daniel Thanks for the advice. I'll probably go with either the Daniel BSD license, or possibly the LGPL. But I'm leaning Daniel towards the BSD since it fits on the screen... Isn't MIT license even shorter and simpler? A while ago some Debian guys were speculating

Debugging Python Scripts inside other processes

2005-03-12 Thread A. Klingenstein
I embedded Python in a Windows C++ program. Now I want to debug my embedded scripts which of course won't run in any IDE process. Commercial IDEs like WingIDE can attach to external processes by importing a module in the scripts. Is there a debugger capable of this which is Free or Open

Re: PEP 309 (Partial Function Application) Idea

2005-03-12 Thread Scott David Daniels
Reinhold Birkenfeld wrote: Steven Bethard wrote: Chris Perkins wrote: Random idea of the day: How about having syntax support for currying/partial function application, like this: func(..., a, b) func(a, ..., b) func(a, b, ...) That is: 1) Make an Ellipsis literal legal syntax in an argument list.

Re: a program to delete duplicate files

2005-03-12 Thread Patrick Useldinger
François Pinard wrote: Identical hashes for different files? The probability of this happening should be extremely small, or else, your hash function is not a good one. We're talking about md5, sha1 or similar. They are all known not to be 100% perfect. I agree it's a rare case, but still, why

Re: head for grouped data - looking for best practice

2005-03-12 Thread Steven Bethard
Harald Massa wrote: def getdoublekey(row): return row[0:2] for key, bereich in groupby(eingabe,getdoublekey): print Area:,key for data in bereich: print --data--, data[2:] Why don't you just pass a slice to itemgetter? py eingabe=[ ... (Stuttgart,70197,Fernsehturm,20), ...

Re: Safe Local XMLRPC

2005-03-12 Thread Michael Urman
[Sorry, I previously replied to Diez offlist, and probably to a spam-protected address at that. Here's that reply and my followup after reading up on pyro ] On Sat, 12 Mar 2005 11:08:31 -0600, Michael Urman [EMAIL PROTECTED] wrote: On Sat, 12 Mar 2005 14:12:21 +0100, Diez B. Roggisch [EMAIL

Generating data types automatically

2005-03-12 Thread Torsten Bronger
Hallchen! I have to generate a lot of data types (for ctypes by the way). An example is ViUInt32 = u_long ViPUInt32 = POINTER(ViUInt32) ViAUInt32 = ViPUInt32 Therefore, I defined functions that should make my life easier: def generate_type_dublett(visa_type, ctypes_type): visa_type_name

Add Properties to Instances?

2005-03-12 Thread Martin Miller
I'm trying to create some read-only instance specific properties, but the following attempt didn't work: class Foobar(object): pass foobar = Foobar() foobar.x = property(fget=lambda: 42) print foobar.x:, foobar.x Which results in the following ouput instead of '42': foobar.x:

Re: Generating data types automatically

2005-03-12 Thread Torsten Bronger
Hallchen! Torsten Bronger [EMAIL PROTECTED] writes: I have to generate a lot of data types (for ctypes by the way). An example is ViUInt32 = u_long ViPUInt32 = POINTER(ViUInt32) ViAUInt32 = ViPUInt32 Therefore, I defined functions that should make my life easier: [...] However, this

Re: Add Properties to Instances?

2005-03-12 Thread Steven Bethard
Martin Miller wrote: I'm trying to create some read-only instance specific properties, but the following attempt didn't work: class Foobar(object): pass foobar = Foobar() foobar.x = property(fget=lambda: 42) print foobar.x:, foobar.x [snip] Can anyone tell me what's wrong with this approach

Re: Debugging Python Scripts inside other processes

2005-03-12 Thread Robin Becker
A. Klingenstein wrote: I embedded Python in a Windows C++ program. Now I want to debug my embedded scripts which of course won't run in any IDE process. Commercial IDEs like WingIDE can attach to external processes by importing a module in the scripts. Is there a debugger capable of this which

Can't seem to insert rows into a MySQL table

2005-03-12 Thread grumfish
I'm trying to add a row to a MySQL table using insert. Here is the code: connection = MySQLdb.connect(host=localhost, user=root, passwd=pw, db=japanese) cursor = connection.cursor() cursor.execute(INSERT INTO edict (kanji, kana, meaning) VALUES (%s, %s, %s), (a, b, c) ) connection.close() After

Re: Generating data types automatically

2005-03-12 Thread Michael Hoffman
Torsten Bronger wrote: def generate_type_dublett(visa_type, ctypes_type): visa_type_name = visa_type.__name__ exec visa_type_name + = + ctypes_type.__name__ exec ViP + visa_type_name[2:] + =POINTER( + visa_type_name + ) You shouldn't need to use exec for this, and it is best to avoid

Re: bsddb support for berkeley db 4.3?

2005-03-12 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: It doesn't seem like the python 2.4(and the recent 2.4.1) support berkeley db 4.3. What makes you say that? It builds fine for me. bsddb3(at pybsddb.sf.net) already supports 4.3 since last December(but doesn't explicitly support win32 -- see the assert statement in

Re: Generating data types automatically

2005-03-12 Thread Steven Bethard
Torsten Bronger wrote: Okay this works: def generate_type_dublett(visa_type, ctypes_type): return visa_type + = + ctypes_type + ; + \ ViP + visa_type[2:] + =POINTER( + visa_type + ) def generate_type_triplett(visa_type, ctypes_type): return generate_type_dublett(visa_type,

Re: Can't seem to insert rows into a MySQL table

2005-03-12 Thread Patrick Useldinger
grumfish wrote: connection = MySQLdb.connect(host=localhost, user=root, passwd=pw, db=japanese) cursor = connection.cursor() cursor.execute(INSERT INTO edict (kanji, kana, meaning) VALUES (%s, %s, %s), (a, b, c) ) connection.close() Just a guess in the dark (I don't use MySQL): is commit

Re: Add Properties to Instances?

2005-03-12 Thread Jeremy Bowers
On Sat, 12 Mar 2005 09:48:42 -0800, Martin Miller wrote: I'm trying to create some read-only instance specific properties, but the following attempt didn't work: I'm going to echo Steven's comment: What's the situation in which you think you want different properties for different instances of

Re: confusion around CustomException example in 'Python in a Nutshell'

2005-03-12 Thread erick_bodine
Peter Hansen wrote: [EMAIL PROTECTED] wrote: In Martinelli's Nutshell book in the Exceptions chapter there is an example of a custom exception class (pg.112) that I am trying to implement without success. The custom exception class example pulls sys.exc_info() into an attribute and I am

Building Python 2.4 with icc and processor-specific optimizations

2005-03-12 Thread Michael Hoffman
Just out of curiosity, I was wondering if anyone has compiled Python 2.4 with the Intel C Compiler and its processor specific optimizations. I can build it fine with OPT=-O3 or OPT=-xN but when I try to combine them I get this as soon as ./python is run: case $MAKEFLAGS in \ *-s*) CC='icc

Re: Debugging Python Scripts inside other processes

2005-03-12 Thread A. Klingenstein
Robin Becker wrote: A. Klingenstein wrote: I embedded Python in a Windows C++ program. Now I want to debug my embedded scripts which of course won't run in any IDE process. Commercial IDEs like WingIDE can attach to external processes by importing a module in the scripts. Is there a debugger

Re: Wishlist item: itertools.flatten

2005-03-12 Thread gene . tani
window / cons / fencepost / slice functions: +1 (with a flag to say if you want to truncate or pad incomplete tuples at end of input sequence. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303279 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303060

Re: Safe Local XMLRPC

2005-03-12 Thread Michael Urman
Thanks for your time everyone; I got it XMLRPC working over unix domain stream sockets. In case people are interested, here's the pieces I put together. I'm sure they throw away a little flexibility, but they work for my purpose. Any pointers to make the code more robust, or do less total

SimpleXMLServer meets inetd

2005-03-12 Thread Marek Kubica
Hi! I was thinking about connecting SimpleXMLRPCServer with inetd.. but I haven't been able to replace the socket by sys.stdin and sys.stdout. Maybe socket.fromfd(sys.stdin.fileno()) could help me, but I can't get it to work, I always get connection refused. Any ideas? greets, Marek --

Re: Can't seem to insert rows into a MySQL table

2005-03-12 Thread Stephen Prinster
grumfish wrote: The rowcount of the cursor is 1 after the execute is 1 and the table's auto_increment value is increased for each insert done. If the auto_increment is increased, then it seems like the row was inserted. Are you sure the problem is not with your SELECT attempt? Just a guess,

Re: PEP 309 (Partial Function Application) Idea

2005-03-12 Thread Chris Perkins
Scott David Daniels wrote: Chris Perkins wrote: Random idea of the day: How about having syntax support for currying/partial function application, like this: func(..., a, b) func(a, ..., b) func(a, b, ...) That is: 1) Make an Ellipsis literal legal syntax in an argument list. 2) Have the compiler

Re: Can't seem to insert rows into a MySQL table

2005-03-12 Thread deelan
grumfish wrote: I'm trying to add a row to a MySQL table using insert. Here is the code: connection = MySQLdb.connect(host=localhost, user=root, passwd=pw, db=japanese) cursor = connection.cursor() cursor.execute(INSERT INTO edict (kanji, kana, meaning) VALUES (%s, %s, %s), (a, b, c) )

Thank you. New question concerning text encoding

2005-03-12 Thread grumfish
Patrick Useldinger wrote: Just a guess in the dark (I don't use MySQL): is commit implicit, or do you have to add it yourself? Thank you. Inserts work fine now. Another question. I'm trying to insert Japanese text into the table. I created the database using 'CHARACTER SET UTF8'. In Python I do

Re: Can't seem to insert rows into a MySQL table

2005-03-12 Thread deelan
deelan wrote: which version of MySQLdb are you running? versions 1.1.6 and below gained a connection.autocommit) method set by default ehm, 1.1.6 and *above*, of course. :) -- Però è bello sapere che, di questi tempi spietati, almeno un mistero sopravvive: l'età di Afef Jnifen. -- dagospia.com --

Re: Safe Local XMLRPC

2005-03-12 Thread Diez B. Roggisch
Hmm. On inspection, pyro seems to be really heavy, what with its requirement of a pyro-nameserver, and using TCP as the transport. The nameserver is purely optional. Regarding the overhead of transport - well, I didn't check pyro on that, but corba is 10-100 times faster over the network than

Installation Guide

2005-03-12 Thread Online Support
Hello, I'm in critical need to install Python Imaging Library on my linux/cpanel server. I'm not very experienced and I almost always have to use instalation guides. I have downloaded the software, unzipped it, and now I think I just need to install it somehow. Are there files that need to be

wishlist item: itertools.partition (WAS: Wishlist item: itertools.flatten)

2005-03-12 Thread Steven Bethard
[EMAIL PROTECTED] wrote: window / cons / fencepost / slice functions: +1 (with a flag to say if you want to truncate or pad incomplete tuples at end of input sequence. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303279

Re: pre-PEP: Print Without Intervening Space

2005-03-12 Thread Marcin Ciura
Bengt Richter wrote: BTW, what makes you think any self-respecting scientist wouldn't be insulted by the idea of your spoon-feeding them a dumbed-down programming equivalent of See Spot run? Am I right thinking that your dream 3 R's curriculum starts with Stately, plump Buck Mulligan and Plya

blocking a program until a non-Python process terminates

2005-03-12 Thread Earl Eiland
I'm running an .exe in Python, using subProcess.Popen. The executable writes data to a file I process later on in the program. Unfortunately, my program returns the error no such file How do I block execution until the external executable terminates? Earl --

Re: Why does this not work?

2005-03-12 Thread Gensek
PingGUI is a program that nobody but me knows anything about. If I wanted help from people who are experts on it, I'd get nothing at all. -- http://mail.python.org/mailman/listinfo/python-list

Re: Installation Guide

2005-03-12 Thread Skip Montanaro
Kevin I'm in critical need to install Python Imaging Library on my Kevin linux/cpanel server. I'm not very experienced and I almost always Kevin have to use instalation guides. Take a look at the BUILDME and README files in the top-level directory. Skip --

Re: Add Properties to Instances?

2005-03-12 Thread Martin Miller
So far a couple of people have asked: What's the situation in which you think you want different properties for different instances of the same class? Fair enough -- here goes: Essentially what I'm doing is implementing (yes, yet another ;-) 'enumeration' class using an an approach which

Re: PEP 309 (Partial Function Application) Idea

2005-03-12 Thread Steven Bethard
Chris Perkins wrote: [snip implementation] While I think that func(x, ...) is more readable than partial(func, x), I'm not sure that I would use either of them often enough to warrant special syntax. Interesting. Thought it might be worth listing a few of the current places people use lambdas

Re: Safe Local XMLRPC

2005-03-12 Thread Stephen Waterbury
Diez B. Roggisch wrote: ... corba is 10-100 times faster over the network than soap/xmlrpc. ... I'm not challenging these statistics (because I don't know), but I would be interested in the source. Are you referring to the results of an actual benchmark, or something more subjective? Steve --

dinamically altering a function

2005-03-12 Thread vegetax
I i need a decorator that adds a local variable in the function it decorates, probably related with nested scopes, for example: def dec(func): def wrapper(obj = None): if not obj : obj = Obj() bind obj to func return func() return wrapper() @dec() def fun(b): obj.desc =

Re: newbie: dictionary - howto get key value

2005-03-12 Thread Bengt Richter
On Thu, 10 Mar 2005 18:56:41 +0100, bruno modulix [EMAIL PROTECTED] wrote: G. Völkl wrote: Hello, I use a dictionary: phone = {'mike':10,'sue':8,'john':3} phone['mike'] -- 10 I want to know who has number 3? 3 -- 'john' Note that you can have many keys with the same value: phone

error sending path to Win OS

2005-03-12 Thread Earl Eiland
os.path.getsize(Inputdirectory + '\\' + Filename) works, but os.path.getsize(Inputdirectory + '\\' + Filename.split('.') + '.ext') Fails reporting no such file or directory InputDirectory\\Filename.ext. os.path.getsize(Inputdirectory + r'\' + Filename.split('.') + '.ext') generates a syntax error.

Re: a program to delete duplicate files

2005-03-12 Thread John Machin
Patrick Useldinger wrote: John Machin wrote: Just look at the efficiency of processing N files of the same size S, where they differ after d bytes: [If they don't differ, d = S] PU: O(Nd) reading time, O(Nd) data comparison time [Actually (N-1)d which is important for small N and

Re: head for grouped data - looking for best practice

2005-03-12 Thread Harald Massa
Steve, Why don't you just pass a slice to itemgetter? py for key, bereich in groupby(eingabe, itemgetter(slice(0, 2))): WHOW, that is great! that makes it really simple, just have to structure the SQL to make a real cut first, serve first structure. Thanks to all who helped! also the

Re: a program to delete duplicate files

2005-03-12 Thread Patrick Useldinger
John Machin wrote: Maybe I was wrong: lawyers are noted for irritating precision. You meant to say in your own defence: If there are *any* number (n = 2) of identical hashes, you'd still need to *RE*-read and *compare* Right, that is what I meant. 2. As others have explained, with a decent

Re: dinamically altering a function

2005-03-12 Thread Steven Bethard
vegetax wrote: I i need a decorator that adds a local variable in the function it decorates, probably related with nested scopes, for example: def dec(func): def wrapper(obj = None): if not obj : obj = Obj() bind obj to func return func() return wrapper() @dec() def fun(b):

Re: is there a problem on this simple code

2005-03-12 Thread jrlen balane
@sir harlin so you are saying that there is nothing wrong in this simple program. On 12 Mar 2005 07:39:31 -0800, Harlin Seritt [EMAIL PROTECTED] wrote: hah, this code is anything but simple... -- http://mail.python.org/mailman/listinfo/python-list --

Re: blocking a program until a non-Python process terminates

2005-03-12 Thread Michael Hoffman
Earl Eiland wrote: I'm running an .exe in Python, using subProcess.Popen. The executable writes data to a file I process later on in the program. Unfortunately, my program returns the error no such file How do I block execution until the external executable terminates? Either: 1) returncode

Re: dinamically altering a function

2005-03-12 Thread vegetax
Steven Bethard wrote: vegetax wrote: I i need a decorator that adds a local variable in the function it decorates, probably related with nested scopes, for example: def dec(func): def wrapper(obj = None): if not obj : obj = Obj() bind obj to func return func()

Re: error sending path to Win OS

2005-03-12 Thread Michael Hoffman
Earl Eiland wrote: os.path.getsize(Inputdirectory + '\\' + Filename) works, but os.path.getsize(Inputdirectory + '\\' + Filename.split('.') + '.ext') Fails reporting no such file or directory InputDirectory\\Filename.ext. No, that should be a TypeError. This will be easier if you copy and paste

Re: error sending path to Win OS

2005-03-12 Thread [EMAIL PROTECTED]
To generate path names take a look at os.path.join(see http://docs.python.org/lib/module-os.path.html) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does this not work?

2005-03-12 Thread Michael Hoffman
Gensek wrote: PingGUI is a program that nobody but me knows anything about. If I wanted help from people who are experts on it, I'd get nothing at all. It appears as if that's the situation anyway, at least so far. But you want wxPython help so you should ask for that instead. Something like Why

Re: csv module and unicode, when or workaround?

2005-03-12 Thread John Machin
Chris wrote: hi, thanks for all replies, I try if I can at least get the work done. I guess my problem mainly was the rather mindflexing (at least for me) coding/decoding of strings... But I guess it would be really helpful to put the UnicodeReader/Writer in the docs UNFORTUNATELY the

Re: dinamically altering a function

2005-03-12 Thread Steven Bethard
vegetax wrote: Steven Bethard wrote: Have you considered using OO here? You might find that this is more easily written as: py class Object(object): ... pass ... py class fun(object): ... def __new__(self, *args): ... if len(args) == 2: ... obj, b = args ...

Re: i18n: looking for expertise

2005-03-12 Thread klappnase
Martin v. Löwis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... klappnase wrote: enc = locale.nl_langinfo(locale.CODESET).lower() Notice that this may fail on systems which don't provide the CODESET information. Recent Linux systems (glibc 6) have it, and so do recent

Re: dinamically altering a function

2005-03-12 Thread Jeremy Bowers
What i want is to declare in the decorator some code that is common to all these functions, so the functions assume that the decorator will be there and wont need to duplicate the code provided by it, and the functions are not known ahead of time, it has to be dynamic. This sounds like a call

Re: PythonWin

2005-03-12 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: I have a Python program that collects user input using msg = Enter the full path and name of the file to be processed: answer = raw_input(msg) If I run it in IDLE, the question is splashed across the execution window, and if it is long, simply wraps to the next line. Most

Re: Confused with classmethods

2005-03-12 Thread Bengt Richter
On Fri, 11 Mar 2005 14:04:26 -0800, jfj [EMAIL PROTECTED] wrote: Hi. Suppose this: def foo (x): print x f = classmethod (foo) class A: pass a=A() a.f = f a.f() # TypeError: 'classmethod' object is not callable! ### I understand that this

Re: a program to delete duplicate files

2005-03-12 Thread John Machin
Patrick Useldinger wrote: John Machin wrote: Maybe I was wrong: lawyers are noted for irritating precision. You meant to say in your own defence: If there are *any* number (n = 2) of identical hashes, you'd still need to *RE*-read and *compare* Right, that is what I meant. 2. As

  1   2   >