Re: module exports a property instead of a class -- Evil?

2005-04-29 Thread Bengt Richter
On 29 Apr 2005 11:02:59 -0700, gry@ll.mit.edu wrote: >I often find myself wanting an instance attribute that can take on only without checking deeply, are you not sharing state among all instance? See following for an alternative way, allowing initializatio

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Mark T
"pythonchallenge" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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.c

Re: Reusing object methods?

2005-04-29 Thread Axel Straschil
Hello! Why not: > class A: > def a_lengthy_method(self, params): > # do some work depending only on data in self and params > > class B(A): pass ? Lg, AXEL. -- http://mail.python.org/mailman/listinfo/python-list

"implementation" of PEP 262 as an academic project

2005-04-29 Thread Maurice LING
Hi all, I reckoned that if I'm on this work, I might as well make it into an academic engineering-type project for my pass degree. Hence, I am sending this posting out to everyone to inform of my intentions. Despite the possible interests in this work, academic requires a 'personal' project wit

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Mike Rovner
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 additional solution, whic

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

2005-04-29 Thread M.E.Farmer
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 What's wrong with : s = s.replace('b

Re: Fast plotting?

2005-04-29 Thread Patrick Ellis
[EMAIL PROTECTED] <[EMAIL PROTECTED]> typed: > Are you sure about these numbers? Most monitors refresh at 70-80Hz, > so unless you have special display hardware, I'm suspicious of these > numbers doubt . I once had a user post to the matplotlib mailing list > that xplt was refreshing at 1000 Hz.

Re: Tkinter weirdness item count

2005-04-29 Thread David Isaac
"phil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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 -- http://mail.python.org/mailman/listinfo/python-list

Re: mbx repair script

2005-04-29 Thread David Isaac
"Donn Cave" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > All mbx files start with a 2048 byte > header, and a valid header can be copied to another > file and still be valid. For example, if the damaged > file still has 2048 bytes of header, > >1. Find or create another mbx

Re: Data smoothing algorithms?

2005-04-29 Thread Charles Krug
"Anthra Norell" <[EMAIL PROTECTED]> writes: > >> Hi, >> > The following are differences of solar declinations from one day to > the next, (never mind the unit). Considering the inertia of a > planet, any progress of (apparent) celestial motion over regular > time intervals has to be highly regula

Re: Killing process

2005-04-29 Thread Harlin Seritt
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. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting an Edge List

2005-04-29 Thread Anthony D'Agostino
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[j+1][0]: edges[j+1],edges[j+2] = edges[j+2],edges[j+1] # swap

Re: Ron Grossi: God is not a man

2005-04-29 Thread Johnny Gentile
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 > > news:[EMAIL PROTECTED] > >> MC05 w

Re: Ron Grossi: God is not a man

2005-04-29 Thread Donald L McDaniel
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 McDani

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread bgs
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 fun. The very first step in 6 was the most

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Shane Hathaway
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.pythonchalle

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread darren kirby
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.pythonchallenge.com > > That was pre

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

2005-04-29 Thread Michael Spencer
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 +1 Michael -- http://mail.python.org/mailman/listinfo/

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Michael Spencer
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 additional solution, whic

[wxPython] Many wxPanel forms in 1 wxFrame

2005-04-29 Thread CYBER
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 hide and show windows inside my frame. Help :) -- http://mail.python.org/mailman/listinfo/

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread David Murmann
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 additional solution, which looks like cqqmsxk.

Re: Killing process

2005-04-29 Thread Peter Hansen
Harlin Seritt wrote: I am using os.getpid() to get the pid value for a script running. I store that value (as a string) to a file. Later when I try to kill that pid (i pull this from the file as a string value) I get errors. [...] File "vngconsole.py", line 27, in StopVngSvc win32api.Termina

Re: Killing process

2005-04-29 Thread Harlin Seritt
Yeah I've kind of figured that. I was just wanting to know what I could use to kill a pid that is a string value. Thanks though. Harlin -- http://mail.python.org/mailman/listinfo/python-list

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

2005-04-29 Thread 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') Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list

Re: Killing process

2005-04-29 Thread Roger Upole
TerminateProcess takes a process handle, not a pid. win32api.OpenProcess will give you a handle. Roger "Harlin Seritt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am using os.getpid() to get the pid value for a script running. I > store that value (as a string) to a f

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread possibilitybox
oh, right, i did only one eighth to check and see if it was scaling near linearly, as i couldn't even run profiling without python dying. i have 400mb ram and 2ghz processor, on freebsd, so it shouldn't be performance. i'll try your suggestions and see how it works. -- http://mail.python.org/ma

Killing process

2005-04-29 Thread Harlin Seritt
I am using os.getpid() to get the pid value for a script running. I store that value (as a string) to a file. Later when I try to kill that pid (i pull this from the file as a string value) I get errors. Using the following lines I get the subsequent error. (pid is a string value) win32api.Termi

Re: Python site-packages and import

2005-04-29 Thread Maurice LING
Peter Saffrey wrote: (apologies for starting a new thread - Google can't retrieve the other message for some reason) Yes, /usr/lib/python/site-packages is in sys.path. This series of commands should explain what I mean: I've put the Python ID3 module in a sub-directory of site-packages as an illust

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

2005-04-29 Thread John Machin
On Sat, 30 Apr 2005 00:40:50 +0100, Michael Hoffman <[EMAIL PROTECTED]> wrote: >John Machin wrote: > > [Michael Hoffman]: >>>John Machin wrote: [Michael Hoffman]: >for row in csv.reader(fileinput.input()): csv.reader requires that if the first arg is a file that it be opened

Re: New Python website

2005-04-29 Thread Maurice LING
lpe wrote: Hi maurice thanks for your interest, that surely looks interesting (and promising) I had no experience with any of the packages you mentioned, but it may well be usefull. Please email me with more details of what you had in mind. Hi, I've just read PEP 262 last night and finds that it do

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Erik Max Francis
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 fun. Good for a Friday.

python and os.system() failure

2005-04-29 Thread kennywiggin
Hi, I'm actually not sure where the error is actually occurring, but the effects are easily reproduced, but not reproducable. By not reproducable, I mean the error does not occur exactly in the same "spot" but it always happens. I have my CD collection ripped to flac, so I have >4000 flacs. I wro

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread 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.pythonchallenge.com That was pretty fun. Good for a Friday. Too bad it

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

2005-04-29 Thread Michael Hoffman
John Machin wrote: > [Michael Hoffman]: John Machin wrote: [Michael Hoffman]: for row in csv.reader(fileinput.input()): csv.reader requires that if the first arg is a file that it be opened in binary mode. fileinput.input() is not a file. Hair-splitter. Is name-calling really necessary? It's an awk

Re: Fast plotting?

2005-04-29 Thread [EMAIL PROTECTED]
Are you sure about these numbers? Most monitors refresh at 70-80Hz, so unless you have special display hardware, I'm suspicious of these numbers doubt . I once had a user post to the matplotlib mailing list that xplt was refreshing at 1000 Hz. I think xplt drops plot requests while requests are

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

2005-04-29 Thread John Machin
On Fri, 29 Apr 2005 23:21:43 +0100, Michael Hoffman <[EMAIL PROTECTED]> wrote: >John Machin wrote: >> [Michael Hoffman]: >> >>>for row in csv.reader(fileinput.input()): >> >> csv.reader requires that if the first arg is a file that it be opened >> in binary mode. > >fileinput.input() is not a fi

Re: I forgot to wind up my example .... ; (

2005-04-29 Thread Dave Rose
So, I forgot the last part of my example that might gel in your mind why Objects are useful in certain situations. Ok so you maybe followed my example of the shopping cart. Let's just forget for a moment the use for shopping carts is for websites. Let's just say you were going to write the l

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

2005-04-29 Thread Michael Hoffman
John Machin wrote: [Michael Hoffman]: for row in csv.reader(fileinput.input()): csv.reader requires that if the first arg is a file that it be opened in binary mode. fileinput.input() is not a file. I have tested this code and it works fine for the provided example. -- Michael Hoffman -- http://mai

Re: Sorting an Edge List

2005-04-29 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Anthony D'Agostino" <[EMAIL PROTECTED]> wrote: > I need to sort this list: > [('A','Y'), ('J','A'), ('Y','J')] like this: > [('A','Y'), ('Y','J'), ('J','A')]. > > Note how the Ys and Js are together. All I need is for the second element of > one tuple to equal t

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

2005-04-29 Thread John Machin
On Fri, 29 Apr 2005 18:54:54 GMT, Peter A. Schott <[EMAIL PROTECTED]> wrote: >That looks promising. > The field numbers are pre-defined at the mainframe level. Of course. Have you managed to acquire a copy of the documentation, or do you have to reverse-engineer it? >This may help me get to my

Re: Sorting an Edge List

2005-04-29 Thread Lonnie Princehouse
Sort demands a unique ordering, which isn't present in your case. You're constructing an Eulerian path. See Fleury's algorithm: http://en.wikipedia.org/wiki/Eulerian_path -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting an Edge List

2005-04-29 Thread bearophileHUGS
Anthony D'Agostino, this is my first raw version, it can fail in lots of ways depending on your input list l (and surely there are better ways to do it), but it's a start: . l = [('A','Y'), ('J','A'), ('Y','J')] . pairs = dict(l) . result = [] . key = pairs.iterkeys().next() . while pairs: . v

Re: Reusing object methods?

2005-04-29 Thread Bengt Richter
On Fri, 29 Apr 2005 19:45:54 +0200, Ivan Voras <[EMAIL PROTECTED]> wrote: > >Can this be done: (this example doesn't work) > > >class A: > > def a_lengthy_method(self, params): > # do some work depending only on data in self and params > >class B: > > def __init__(self): >

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread R. C. James Harlow
On Friday 29 April 2005 11:53, Ville Vainio wrote: > > "Kent" == Kent Johnson <[EMAIL PROTECTED]> writes: > > Kent> if frequency.has_key(word): > Kent> frequency[word] += 1 > Kent> else: > Kent> frequency[word] = 1 > > This is a good place to use 'get' method of dict: > > freque

Sorting an Edge List

2005-04-29 Thread Anthony D'Agostino
I need to sort this list: [('A','Y'), ('J','A'), ('Y','J')] like this: [('A','Y'), ('Y','J'), ('J','A')]. Note how the Ys and Js are together. All I need is for the second element of one tuple to equal the first element of the next tuple. Another valid solution is [('J','A'), ('A','Y'), ('Y','J'

Re: Can'r run BLT twice?

2005-04-29 Thread Ron Adam
Todd Krein wrote: I'm running PythonWin on XP. When I run my plotter program the first time, it works fine. The second time I run it, I get the following error. If I exit PythonWin, and restart, I can again run it once. Any ideas? Error: 1 TclError Exception in Tk callback Function: > (type: )

Re: module exports a property instead of a class -- Evil?

2005-04-29 Thread gry
Hmm, I had no idea that "property" was a class. It's listed in the library reference manual under builtin-functions. That will certainly make things neater. Thanks! -- George -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive web graphics

2005-04-29 Thread Eckhoff, Michael A
On 2005-04-29 Diez Roggisch wrote: > Take qt if you can - the upcoming version qt4 will be GPLed for windows > (which means better binary support for windows), but recently the qt3 x11 > free edition got adapted to windows. I use that myself, and have to say > that I'm pretty impressed - apart fro

Re: OOP

2005-04-29 Thread GMane Python
As with most things, you have to understand 'why' you want to do something before you can really understand how it applies. Ok. Go to amazon. They've setup a 'shopping cart'. That cart is made of variables, name, cred.card num, items, quantity of items, ship-to address, state, shipping cost, sh

Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread pythonchallenge
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 -- http://mail.python.org/mailman/listinfo/python-list

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

2005-04-29 Thread M.E.Farmer
I found an excellent example that was posted by the F-bot. Fredrik Lundh May 26 2000 From: "Fredrik Lundh" <[EMAIL PROTECTED]> Date: 2000/05/26 richard_chamberl...@ wrote: > I'm having great difficulties getting Python to work via CGI. > Is there anyway I can get the traceback on to the web p

Re: Working with method-wrapper objects

2005-04-29 Thread Bengt Richter
On Thu, 28 Apr 2005 11:33:04 +0200, "Dr. Peer Griebel" <[EMAIL PROTECTED]> wrote: >Peer Dr. Griebel wrote: [..] >> Why has [].__str__ a different type than object.__str__? >> Why is object.__str__ a routine while object().__str__ not? Why wouldn't you expect different types? Those are different e

Re: Which IDE is recommended?

2005-04-29 Thread Ville Vainio
> "John" == John J Lee <[EMAIL PROTECTED]> writes: John> Dave Cook <[EMAIL PROTECTED]> writes: John> What are those compelling features of Pydev, for an emacs John> user? http://pydev.sourceforge.net/features.html Code completion and debugger are the most obvious ones. Eclipse i

Re: Reusing object methods?

2005-04-29 Thread Peter Otten
Ivan Voras wrote: > I want to 'reuse' the same method from class A in class B, and without > introducing a common ancestor for both of them - is this possible in an > elegant, straightforward way? Straightforward, if not elegant: >>> def method(self, params): ... print self, params ... >>> c

Re: Can .py be complied?

2005-04-29 Thread John J. Lee
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 b

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

2005-04-29 Thread M.E.Farmer
Just in case you don't have a clue what they are talking about ;) import traceback try: #your stuff here except: traceback.print_exc() That should return any exceptions you may be throwing. -- http://mail.python.org/mailman/listinfo/python-list

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Caleb Hattingh
In fact, as one of the Peter's (either Otten or Hansen) explained to me, for line in open(file): is actually both faster (being buffered) and generally better for very large files because it doesn't read the whole file into memory, like readlines does (if you have a memory limitation). On Fri,

Re: Can .py be complied?

2005-04-29 Thread John J. Lee
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 and its co

Llearn a Little About Artificial Neural Networks and TKinter

2005-04-29 Thread I. Myself
The VizANN package is a free download from annevolve.sf.net. It contains a python program that graphically demonstrates a recurrent binary neural network. There is also an explanatory text file. Mitchell Timin -- "In theory, there is no difference between theory and practice. In practice, the

Re: module exports a property instead of a class -- Evil?

2005-04-29 Thread Lonnie Princehouse
The property factory is nice, but have you considered subclassing property? class Mode(property): def __init__(self, *vals): if [v for v in vals if not isinstance(v,str)]: raise ValueError, 'Mode values must be strings' else: self.values = list(vals) property.__init__(sel

Re: Which IDE is recommended?

2005-04-29 Thread John J. Lee
Dave Cook <[EMAIL PROTECTED]> writes: > On 2005-04-27, monkey <[EMAIL PROTECTED]> wrote: [...] > Pydev has some compelling features, but I wish I didn't have to run eclipse [...] What are those compelling features of Pydev, for an emacs user? John -- http://mail.python.org/mailman/listinfo/py

Re: Data smoothing algorithms?

2005-04-29 Thread Larry Bates
Sounds like what you are looking for is spline interpolation. Given a set of datapoints is passes spline curves through each point giving you smooth transitions. Did a lot of this in Fortran MANY years ago. Google turned up: http://www.scipy.org/documentation/apidocs/scipy/scipy.interpolate.html

Tkinter weirdness item count

2005-04-29 Thread phil
Using Tkinter Canvas to teach High School Geometry with A LOT of success. My drawing gets very slow after a lot of actions. For instance I have created code to rotate a set of objects about a rotation point. rotate 360 degrees starts to get slow after 720 degrees its crawling. I checked the item li

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

2005-04-29 Thread Peter A.Schott
That looks promising. The field numbers are pre-defined at the mainframe level. This may help me get to my ultimate goal which is to pump these into a DB on a row-by-row basis ( :-P ) I'll have to do some playing around with this. I knew that it looked like a dictionary, but wasn't sure how bes

Re: Data smoothing algorithms?

2005-04-29 Thread John J. Lee
"Anthra Norell" <[EMAIL PROTECTED]> writes: > Hi, > > The following are differences of solar declinations from one day to > the next, (never mind the unit). Considering the inertia of a > planet, any progress of (apparent) celestial motion over regular > time intervals has to be highly regular to

tkinter OptionMenu column break

2005-04-29 Thread erikober
I'm creating a OptionMenu button for a gui and I'm having a problem where the drop down list is so long that most of the options are off screen. The correct behavior would be that another drop down menu list would be created next to it with the continued options. Here is the small code snippet th

Re: Reusing object methods?

2005-04-29 Thread Leif K-Brooks
Ivan Voras wrote: I want to 'reuse' the same method from class A in class B, and without introducing a common ancestor for both of them - is this possible in an elegant, straightforward way? >>> import new >>> >>> class A: ... def foo(self): ... print "Hello, %s!" % self.__class__.__n

Re: Reusing object methods?

2005-04-29 Thread Ivan Voras
Jp Calderone wrote: I want to 'reuse' the same method from class A in class B, and without introducing a common ancestor for both of them - is this possible in an elegant, straightforward way? This is what sub-classing is for. If it makes you feel better, call it "mixing in" instead. You can

[newbie] Embedding Flash OCX object

2005-04-29 Thread Exeem
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 embbed it inside my application in order to distribute my app

Re: Reusing object methods?

2005-04-29 Thread Jp Calderone
On Fri, 29 Apr 2005 19:45:54 +0200, Ivan Voras <[EMAIL PROTECTED]> wrote: Can this be done: (this example doesn't work) class A: def a_lengthy_method(self, params): # do some work depending only on data in self and params class B: def __init__(self): self.a_lengthy_met

module exports a property instead of a class -- Evil?

2005-04-29 Thread gry
I often find myself wanting an instance attribute that can take on only a few fixed symbolic values. (This is less functionality than an enum, since there are no *numbers* associated with the values). I do want the thing to fiercely object to assignments or comparisons with inappropriate values.

Re: __del__ and logging

2005-04-29 Thread Vinay Sajip
flupke nonexistingdomain.com> writes: > > Hi, > > i have a class and a class attribute log which is a logger object. In > the __del__() function i want to log a message but it fails even if i > use self.__class__.log. > > The error i get is this: > Traceback (most recent call last): >Fil

Reusing object methods?

2005-04-29 Thread Ivan Voras
Can this be done: (this example doesn't work) class A: def a_lengthy_method(self, params): # do some work depending only on data in self and params class B: def __init__(self): self.a_lengthy_method = A.a_lengthy_method # I know that data in "self" of class B o

Re: logging problems

2005-04-29 Thread Vinay Sajip
Simon Dahlbacka gmail.com> writes: This is a known problem, and a patch was put into CVS. I would suggest that you either check out the version from CVS, or move the "import traceback" to the top of the module. The problem is caused by a threading deadlock which occurs when an importer tries to

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

2005-04-29 Thread Lonnie Princehouse
key and cmp are equivalent for non-trivial cases (defined below), and for trivial cases the performance will be a trade-off between more function calls with cmp versus more memory use with key. Granted, for the smallish lists that the majority of Python sorts are done on, key is probably the bette

Re: doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Done. -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest's ELLIPSIS

2005-04-29 Thread Michele Simionato
I would file a bug report/documentation bug/feature request or whatever to sourceforge. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Doh ! Obviously ... too bad. I guess that I could set doctest.ELLIPSIS_MARKER to "[...]" to distinguish the two usages of "...". (The "..." used for multiline statements is hard-coded into a regular expression pattern). But it feels too hackish, ELLIPSIS_MATKER being not described in the docs ..

RE: Problem with embedded python - bug?

2005-04-29 Thread Ugo Di Girolamo
I have been having a few more discussions around about this, and I'm starting to think that this is a bug. My take is that, when I call Py_Finalize, the python thread should be shut down gracefully, closing the file and everything. Maybe I'm missing a call to something (?PyEval_FinalizeThreads

Re: Can'r run BLT twice?

2005-04-29 Thread Ron Adam
Todd Krein wrote: I'm running PythonWin on XP. When I run my plotter program the first time, it works fine. The second time I run it, I get the following error. If I exit PythonWin, and restart, I can again run it once. Any ideas? Error: 1 TclError Exception in Tk callback Function: > (type: )

Re: Ron Grossi: God is not a man

2005-04-29 Thread AKA
"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 PROTECTED

Re: doctest's ELLIPSIS

2005-04-29 Thread Michele Simionato
I think doctest believes the line starting with ... is a continuation line in a multiline statement. -- http://mail.python.org/mailman/listinfo/python-list

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Kent Johnson
Maksim Kasimov wrote: Kent Johnson wrote: > for line in open(path): the line of your example raise another question: opened file will be read at once time, as method readlines() do, or it will be read line by line as method readline() do. It will be read line by line as readline() does. as far i

Re: how to pass an array to a VB array via COM

2005-04-29 Thread jelle
Hi Stefan, Thanks for your insightful and in-depth response! Wonderful to hear that a solution is in the works, that's absolutely wonderful news. If I can help you out beta-testing the PySafeArray implementation, I'd be delighted to do so. Thanks again, Jelle. -- http://mail.python.org/mailman/l

doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Hi, Can anybody come up with a sensible argument that would explain why the following test should fail ? (Expected: nothing, Got: 42). cheers, S.B. #!/usr/bin/env python import doctest def test(): """ >>> print 42 #doctest: +ELLIPSIS ...

Re: Can .py be complied?

2005-04-29 Thread Steve Holden
steve.leach wrote: python -o foo.exe foo.py at the command line, and get an executable, without any further effort. Hence making the resulting program useless to users of most operating systems. Let's ignore for the moment whether including py2exe as a "battery" is a desirable thing from an abst

WSDL.Proxy newbie question

2005-04-29 Thread dresserd
Hello, I am new to implementing and consuming web services with Python. I have had some success setting up a simple SOAPServer and connecting to it and also using some of the simpler (one parameter) web services available from xmethods.org. I am currently stuck trying to use a simple hashing serv

Sockets SO_RCVBUF

2005-04-29 Thread Josh
I have written a simple TCP client/server. I would like to change the TCP receive buffer on the server side, to see performance differences. I am trying err = sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 4096) but that doesn't seem to actual change the buffer size. The code is:

Need some help to understand Python program..

2005-04-29 Thread Jaeho Kim
Hi,,, I am very interested about the following Python program, but I am very beginner on Python.. I do not understand this algorithm,, I would appreciated if you give me this algorithm to some other popular programming language. filename="Karp.py" from __future__ import nested_scopes impor

Re: Ron Grossi: God is not a man

2005-04-29 Thread Donald L McDaniel
MC05 wrote: > "sheltech" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> "MC05" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> >>> "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message >>> news:[EMAIL PROTECTED] 4) I doubt seriously whether God p

[ANN] Voidspace Python Guestbook 1.4.1 (etc)

2005-04-29 Thread Fuzzyman
My Honoured Guests = Yup... the time has come, **The Voidspace Python Guestbook 1.4.1** has been released into the wild. * `The Guestbook Homepage`__ * `Quick Download Link (120k)`__ * `Plain Guestbook Example`__ * `Voidspace Guestbook`__ [#]_ __ http://www.voidsapce.org.uk/p

ANN: python-ldap-2.0.7

2005-04-29 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. p

Re: Getting PID for process

2005-04-29 Thread runes
On XP/2003 at least, os.system('taskkill /pid le ') will do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ron Grossi: God is not a man

2005-04-29 Thread MC05
"sheltech" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "MC05" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > >> > 4) I doubt seriously whether God plays a guitar, since

Re: New Python website

2005-04-29 Thread lpe
Hi maurice thanks for your interest, that surely looks interesting (and promising) I had no experience with any of the packages you mentioned, but it may well be usefull. Please email me with more details of what you had in mind. -- http://mail.python.org/mailman/listinfo/python-list

Re: undefined symbol: PyUnicodeUCS4_AsUTF8String

2005-04-29 Thread Diez B. Roggisch
Michael Ströder wrote: > HI! > > I have the following problem after system upgrade to SuSE Linux 9.3: > > $ python -c "import cPickle" > Traceback (most recent call last): > File "", line 1, in ? > ImportError: /usr/lib/python2.4/lib-dynload/cPickle.so: undefined > symbol: PyUnicodeUCS4_AsUTF8

undefined symbol: PyUnicodeUCS4_AsUTF8String

2005-04-29 Thread Michael Ströder
HI! I have the following problem after system upgrade to SuSE Linux 9.3: $ python -c "import cPickle" Traceback (most recent call last): File "", line 1, in ? ImportError: /usr/lib/python2.4/lib-dynload/cPickle.so: undefined symbol: PyUnicodeUCS4_AsUTF8String The Python 2.4.1 installation was

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Maksim Kasimov
Kent Johnson wrote: Here is a little cleaner version. It takes about a second to run on my PC. What hardware are you running on? path = 'DonQuixote.txt' frequency = {} for line in open(path): for word in line.split(): if frequency.has_key(word): frequency[word] += 1

Re: anonymous function objects?

2005-04-29 Thread Michele Simionato
I have not access to Guido's time machine! M. S. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to create temporary file?

2005-04-29 Thread Fabio Pliger
"Frank Millman" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Hi all > > I need to generate potentially large reports from a database, and I > want to offer the option of print preview before actually printing > (using wxPython). I figure that the best way to achieve this i

  1   2   >