Re: exercise: partition a list by equivalence - merge_JM.py (0/1)

2005-02-19 Thread John Machin
On 19 Feb 2005 17:56:27 -0800, [EMAIL PROTECTED] wrote: >John Machin>FWIW, here's a brief UAT report: > >Here is something else for you. >Note: for more correct comparisons, for the following tests I've >disabled the use of Psyco in Graph (usually enabled, if present). >This looks faster than merg

newbie question - exception processing

2005-02-19 Thread mirandacascade
O/S: Windows XP Service Pack 2 Python version: 2.4 Unable to understand how to build a class to handle an exception. Contents of sample01.py: import exceptions class SampleMain: try: def __init__(self): print 'in SampleMain constructor' def Allowed(self):

Re: How Do I get Know What Attributes/Functions In A Class?

2005-02-19 Thread Hans Nowak
[EMAIL PROTECTED] wrote: Hi, I'm new to python. Given a class, how can I get know what attributes/functins in it without dig into the source? Use the dir function: >>> from smtplib import SMTP >>> dir(SMTP) ['__doc__', '__init__', '__module__', 'close', 'connect', 'data', 'debuglevel', 'docmd', '

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-19 Thread Donn Cave
Quoth Nick Coghlan <[EMAIL PROTECTED]>: [... re Python OS interface vs. language-generic model ] | *Allowing* other languages is one thing, but that shouldn't preclude having a | 'default' language. On other OS's, the default language is some form of shell | scripting (i.e. Unix shell scripts, o

Re: Why doesn't join() call str() on its arguments?

2005-02-19 Thread Rocco Moretti
Jeff Shannon wrote: news.sydney.pipenetworks.com wrote: Fredrik Lundh wrote: a certain "princess bride" quote would fit here, I think. I'm not really familiar with it, can you enlighten please. (Taking a guess at which quote /F had in mind...) Vezzini: "Inconceivable!" Inigo:"You keep using th

Re: lambda closure question

2005-02-19 Thread Ted Lilley
I replied a few minutes ago thanking everyone for their pointers. Very interesting reading. I don't see my post yet, so I do hope it comes through. I'm using a new newsreading service and don't yet have confidence in it. In any case, the addition of the default-setting argument in the lambda wo

Re: lambda closure question

2005-02-19 Thread Ted Lilley
Wow, a lot of great discussion. Almost a bit too much for me to grasp...I do see two or more nuggets that really address my issue. As a side note, I'm familiar with the term currying from a friend who learned ML and Scheme quite some time ago. Not sure if that's the true origin, but it was a suf

Re: Loading functions from a file during run-time

2005-02-19 Thread Bryant Huang
Ah, thank you, Wensheng and T.J.! I have drawn bits and pieces from what you have suggested. Both of your solutions work well. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-19 Thread Nick Coghlan
Paul Rubin wrote: Nick Coghlan <[EMAIL PROTECTED]> writes: Compare out-of-the-box Python: a = 1 + 2 + 3 + 4 And out-of-the-box Lisp: (setq a (+ 1 2 3 4)) Which language has the lower barrier for entry? That should be a fairly important consideration for a language that is going to sit at the he

How Do I get Know What Attributes/Functions In A Class?

2005-02-19 Thread steven
Hi, I'm new to python. Given a class, how can I get know what attributes/functins in it without dig into the source? - narke -- http://mail.python.org/mailman/listinfo/python-list

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-19 Thread Paul Rubin
Nick Coghlan <[EMAIL PROTECTED]> writes: > Compare out-of-the-box Python: >a = 1 + 2 + 3 + 4 > > And out-of-the-box Lisp: >(setq a (+ 1 2 3 4)) > > Which language has the lower barrier for entry? That should be a > fairly important consideration for a language that is going to sit at > th

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-19 Thread Nick Coghlan
Mike Meyer wrote: Arich Chanachai <[EMAIL PROTECTED]> writes: Mike Meyer wrote: Whatever the intentions may be, the *act* is one of dictation. Since the point of the underlying OS is to increase the interconnections between applications (assuming I've found the correct web page and interpreted it

Re: Matplotlib, py2exe and pytz

2005-02-19 Thread scott
I unzipped library.zip to see what compiled python files were included in the zip. As in the error stacktrace the Pytz.timezone package was not part of the library. After manually adding it and rezipping the library I ran into another missing module, this time it was missing backend_agg Traceback

Re: unicode encoding usablilty problem

2005-02-19 Thread Nick Coghlan
Thomas Heller wrote: =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> writes: We have come up with a transition strategy, allowing existing libraries to widen their support from byte strings to character strings. This isn't a simple task, so many libraries still expect and return by

Re: global var

2005-02-19 Thread Nick Coghlan
Michael Hoffman wrote: raver2046 wrote: How to have a global var in python ? "global var" will give you a global variable named "var". Whether this advice is correct or not depends greatly on what the OP means by 'global' :) Module global, it's right, application global it's wrong. Given the nat

Re: pyFMOD writing a callback function in Python

2005-02-19 Thread Gary Bishop
I haven't tried it on Linux but I believe it should work. FMOD works on Linux as does Pyrex. I don't think there is any win32 specific code. Grab the source and try building it. You'll likely have to fool with the libraries and includes in setup.py. gb Marian Aldenh?vel <[EMAIL PROTECTED]> wrot

Re: multimethod (or rather overloading) in Python

2005-02-19 Thread Nick Coghlan
anton muhin wrote: anton muhin wrote: Correction: Of course, I can imagine some metaclasses magic that would allow to code: class MyClass(WithOverloading): @overloadMethod(A) def someMetod(self, _): ... But it would rather convoluted: the best idea I have so far is to mangle methods name in t

Re: exercise: partition a list by equivalence

2005-02-19 Thread bearophileHUGS
John Machin>FWIW, here's a brief UAT report: Here is something else for you. Note: for more correct comparisons, for the following tests I've disabled the use of Psyco in Graph (usually enabled, if present). This looks faster than merge2 for this (quite sparse) random pairs test: . import graph #

Re: Fuzzy matching of postal addresses

2005-02-19 Thread Tim Churches
McBooCzech wrote: Sorry for my "Ferbl typo". No offense was caused, I was just joking. For the local anti-smoking campaign As a public health epidemiologist, that's the sort of application of our project I like to see! And judging by the reports by Martin Mcgee and colleagues at the European

Re: [ANN] Python 2.4 Quick Reference available

2005-02-19 Thread George Sakkis
"David M. Cooke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Pete Havens" <[EMAIL PROTECTED]> writes: > > > The is awesome! Thanks. I did notice one thing while reading it. In the > > "File Object" section, it states: > > > > "Created with built-in functions open() [preferred] o

Re: Matplotlib, py2exe and pytz

2005-02-19 Thread John Hunter
> "scott" == scott <[EMAIL PROTECTED]> writes: scott> I am trying to convert a python app that uses matplotlib to scott> a standalone executable using py2exe. scott> After running py2exe and executing my app I get the scott> following stack trace: scott> Traceback (most

Re: Why doesn't join() call str() on its arguments?

2005-02-19 Thread Nick Coghlan
news.sydney.pipenetworks.com wrote: I see your point but I'm not totally convinced I don't understand unicode that well so I'll just be quiet now. Unicode is horrible, but better than the available alternatives when it comes to character sets with more than 128 characters :) Your point about in

Re: Fuzzy matching of postal addresses

2005-02-19 Thread McBooCzech
Sorry for my "Ferbl typo". For the local anti-smoking campaign I am trying to link some addresses which contain following "linkable" informations (data fields) only: RECORD_ID, Street + No., City, Post code, All data are now w/o Unicode characters. Do you think it possible to try to link it with

Re: Error when display socekt content

2005-02-19 Thread Peter Hansen
[EMAIL PROTECTED] wrote: The displayed string looks like some wierd chars (unreadable to human being at all), when I tried to display the received message by socket. I read by this line: body = self.io.blockingRead (int(header.getFieldCN ('Content-Length'))) print "socket content: " + body I am

Re: controlling a qbasic program on a windows98 or example of rs-232 commanded through python

2005-02-19 Thread Peter Hansen
[EMAIL PROTECTED] wrote: Can python be installed on a win98 system ? Yes. The Windows version of Python works on most versions of Windows including Win98. if so, how do I control a qbasic program from python ? Given the rest of your posting, I would say "don't bother". the qbasic program controls

segfault when calling Python from C thread

2005-02-19 Thread Travis Berg
I'm running into a problem when trying to perform a callback to a Python function from a C extension. Specifically, the callback is being made by a pthread that seems to cause the problem. If I call the callback from the parent process, it works fine. The PyObject is static, and holds the same

Re: exercise: partition a list by equivalence

2005-02-19 Thread Xah Lee
an interesting problem so developed now is to write a function that generate test cases for the purpose of testing performance. (just for fun) the design of this function could be interesting. We want to be able to give parameters in this function so as to spit out all possible screw test cases. F

Re: Distutils: relative paths

2005-02-19 Thread George Sakkis
"Frans Englich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hello, > > I have trouble installing a data directory which is not a child of my package > directory in the source directory. > > My source directory looks like this: > > ./setup.py > schemas/*.xsd > foo/*.py > > And w

Error when display socekt content

2005-02-19 Thread [EMAIL PROTECTED]
Hello all, The displayed string looks like some wierd chars (unreadable to human being at all), when I tried to display the received message by socket. I read by this line: body = self.io.blockingRead (int(header.getFieldCN ('Content-Length'))) print "socket content: " + body I am new to pyth

Re: PIL Expand Canvas

2005-02-19 Thread Will McGugan
Daniel Bowett wrote: I'm new to the PIL module but think it would be useful for dealing with all the product images for the sites I work on. I can see how to do most things I need apart from expanding the canvas. By that I mean if I have an image which is 200 pixels high and 180 pixels wide - I

Re: could that be a mutable object issue ?

2005-02-19 Thread Philippe C. Martin
You are correct and I still don't know Python (sigh). Thanks Philippe On Sat, 19 Feb 2005 15:51:18 -0500, Kent Johnson wrote: > Philippe C. Martin wrote: >> If I do this: >> >> >> >> print 'LEN OF BOOK BEFORE APPEND: ', len(pickle.dumps(self.__m_rw)) >> self.__m_rw.books.append( [p_col1,p_c

Re: Annoying Socket Problem

2005-02-19 Thread John Abel
Never mind, sorted now. On 18 Feb 2005, at 15:10, John Abel wrote: Read/tried that before posting. Even with a flush, everything hangs until I kill the client. Irmen de Jong wrote: John Abel wrote: I'm hoping this is something simple, and someone can point me in the right direction here. I h

Re: exercise: partition a list by equivalence

2005-02-19 Thread John Machin
Reinhold Birkenfeld wrote: > Xah Lee wrote: > > here's the answer to the partition by equivalence exercise. > > Your Python solution is, as expected, wrong (try with > [[10, 8], [7, 3], [1, 7], [5, 4], [2, 2], [3, 8], [7, 10], [2, 3], [6, > 10], [3, 2]] > for example). > > The solution by John Len

socket or xml error?

2005-02-19 Thread [EMAIL PROTECTED]
I got an error as following. The Server/cllient program was written by somebody else and supposed to be working before. Whenever I start a new client to load xml data from server, the program will fail as: File "ShowAllData.py", line 157, in ? main(sys.argv) File "ShowAllData.py", line 1

Creditwrench

2005-02-19 Thread Creditwrench
And the truth shall set ye free http://www.creditwrench-thetruth.blogspot.com/ Uncle Normie -- http://mail.python.org/mailman/listinfo/python-list

Distutils: relative paths

2005-02-19 Thread Frans Englich
Hello, I have trouble installing a data directory which is not a child of my package directory in the source directory. My source directory looks like this: ./setup.py schemas/*.xsd foo/*.py And when it's installed, it should look like: site-packages/foo/*.py site-packages/foo/schemas/*.xsd

Re: [perl-python] exercise: partition a list by equivalence

2005-02-19 Thread Brian Beck
Reinhold Birkenfeld wrote: def merge(pairings): sets = {} for x1, x2 in pairings: newset = (sets.get(x1, frozenset([x1])) | sets.get(x2, frozenset([x2]))) for i in newset: sets[i] = newset return [list(aset) for aset in set(sets.itervalues()

PIL Expand Canvas

2005-02-19 Thread Daniel Bowett
I'm new to the PIL module but think it would be useful for dealing with all the product images for the sites I work on. I can see how to do most things I need apart from expanding the canvas. By that I mean if I have an image which is 200 pixels high and 180 pixels wide - I will want to pad it

controlling a qbasic program on a windows98 or example of rs-232 commanded through python

2005-02-19 Thread [EMAIL PROTECTED]
Hello, Can python be installed on a win98 system ? if so, how do I control a qbasic program from python ? the qbasic program controls input to an RS-232 so I am enclined to follow the win98 system + qbasic route in order to be quick, or I guess the question could be, can I control a device throug

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Pat
Diez B. Roggisch wrote: > > >> Just out of curiousity: How many python extensions are you planning to > >> write? > > > > I estimate 10 to 100, depending on abstractional capabilities of the > > extension system. > > > >> And how many lines of pure python code have you written in your life? > > > >

Re: exercise: partition a list by equivalence

2005-02-19 Thread Xah Lee
The GOTO statement from Perl has been messed up. This block: ©for group in interm: ©for newcoup in fin: ©for k in group.keys(): ©if newcoup.has_key(k): ©for kk in group.keys(): newcoup[kk]='x'; ©break ©break ©

Re: could that be a mutable object issue ?

2005-02-19 Thread Kent Johnson
Philippe C. Martin wrote: If I do this: print 'LEN OF BOOK BEFORE APPEND: ', len(pickle.dumps(self.__m_rw)) self.__m_rw.books.append( [p_col1,p_col2,p_col3] ) print 'LEN OF BOOK AFTER APPEND: ', len(pickle.dumps(self.__m_rw)) I get the same length before and after append. when I print self.__m_rw.

Re: Pausing a program - poll/sleep/threads?

2005-02-19 Thread Jarek Zgoda
Simon John napisał(a): Damn, seems Qt GUI objects (windgets) aren't thread-safe: http://doc.trolltech.com/3.3/threads.html#11 Like most (if not all) others GUI toolkits. So I'm going to have to find a way of using a thread to fetch the data, and then using the main program to update the GUI... Some

Re: Pausing a program - poll/sleep/threads?

2005-02-19 Thread Simon John
Damn, seems Qt GUI objects (windgets) aren't thread-safe: http://doc.trolltech.com/3.3/threads.html#11 So I'm going to have to find a way of using a thread to fetch the data, and then using the main program to update the GUI... Someone suggested using events: http://mail.python.org/pipermail/pyt

Re: Chart Director?

2005-02-19 Thread kdahlhaus
Actually, that's exactly what I did last night. I found it all of the things you said. Consistent api across functions, lots of methods of formatting data labels. A+ on the documentation and examples. It also includes various meters and gauges that I thought might add to the application. I'm

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread A.B., Khalid
Ilias Lazaridis wrote: > A.B., Khalid wrote: > > Ilias Lazaridis wrote: > > > >>The first step is to make a pyMinGW project. > > > > You are mistaken. The first steps are the following: > [...] - (nonrelevant comments) > > > 3) Realizing that there _is_ already a project called pyMinGW! That it > >

Re: exercise: partition a list by equivalence

2005-02-19 Thread David Eppstein
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > David Eppstein: > > However it might be easier to treat the input pairs as the edges of a > > graph and apply a depth-first-search based graph connected components > > algorithm. || This would be O(n), though. > > Is the DFS the best one

Re: [ANN] Python 2.4 Quick Reference available

2005-02-19 Thread David M. Cooke
"Pete Havens" <[EMAIL PROTECTED]> writes: > The is awesome! Thanks. I did notice one thing while reading it. In the > "File Object" section, it states: > > "Created with built-in functions open() [preferred] or its alias > file()." > > ...this seems to be the opposite of the Python documentation:

Re: Pausing a program - poll/sleep/threads?

2005-02-19 Thread Simon John
OK, I've implemented the 2sec threaded update, but I'm having some problems with it. Basically the thread will have to just run constantly, never exiting (just sleeping for 2secs), which seems to work OK except when I try to get the thread to do anything with the main program's window. As the thr

pyWrath project

2005-02-19 Thread [EMAIL PROTECTED]
Privet! I am bifacial, admin of the pywrath project (http://sourcefoge.net/projects/pywrath). PyWrath is PBeM game/emgine for python, based on principles of futuristic warfare. PyWrath is still in very early fase of development, and we are in constant need of developers. We are accepting each and

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Ilias Lazaridis
Diez B. Roggisch wrote: Thank you for the links. They are irrelevant for me. As usual. sorry. Just out of curiousity: How many python extensions are you planning to write? I estimate 10 to 100, depending on abstractional capabilities of the extension system. And how many lines of pure python code

Re: exercise: partition a list by equivalence

2005-02-19 Thread bearophileHUGS
Bearophile: > I presume the complexity is O(n+a); n (the nodes) > is proportional to the number of pairs, and a > (the arcs) depends on the "intricacy" of the input pairs. Opps... n (the number of nodes) is the number of different numbers contained in the pairs :-] Bearophile -- http://mail.pyt

Re: exercise: partition a list by equivalence

2005-02-19 Thread bearophileHUGS
David Eppstein: > However it might be easier to treat the input pairs as the edges of a > graph and apply a depth-first-search based graph connected components > algorithm. || This would be O(n), though. Is the DFS the best one here (instead of BFS)? With the graph implementation that I've just s

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Diez B. Roggisch
> Thank you for the links. > > They are irrelevant for me. As usual. >> Just out of curiousity: How many python extensions are you planning to >> write? > > I estimate 10 to 100, depending on abstractional capabilities of the > extension system. > >> And how many lines of pure python code hav

Re: could that be a mutable object issue ?

2005-02-19 Thread Philippe C. Martin
Yes, and that is my initial problem: I seem to write correctly that 'pickle string' to a device, by when I read it back, the appended information is gone. On Sat, 19 Feb 2005 19:13:58 +0100, Fredrik Lundh wrote: > Philippe C. Martin wrote: > >> print 'LEN OF BOOK BEFORE APPEND: ', len(pickle.du

Re: lambda closure question

2005-02-19 Thread Steven Bethard
Carl Banks wrote: You may not be aware of it, but what you're trying to do is called "currying"; you might want to search the Python Cookbook for recipes on it. Or look for "partial function application" which has been argued to be the correct term for this use... Also see PEP 309: http://www.py

Re: could that be a mutable object issue ?

2005-02-19 Thread Fredrik Lundh
Philippe C. Martin wrote: > print 'LEN OF BOOK BEFORE APPEND: ', len(pickle.dumps(self.__m_rw)) > self.__m_rw.books.append( [p_col1,p_col2,p_col3] ) > print 'LEN OF BOOK AFTER APPEND: ', len(pickle.dumps(self.__m_rw)) > > I get the same length before and after append. > > when I print self.__m_rw.

could that be a mutable object issue ?

2005-02-19 Thread Philippe C. Martin
If I do this: print 'LEN OF BOOK BEFORE APPEND: ', len(pickle.dumps(self.__m_rw)) self.__m_rw.books.append( [p_col1,p_col2,p_col3] ) print 'LEN OF BOOK AFTER APPEND: ', len(pickle.dumps(self.__m_rw)) I get the same length before and after append. when I print self.__m_rw.books, I see my 'appen

Re: unicode encoding usablilty problem

2005-02-19 Thread Fredrik Lundh
"aurora" <[EMAIL PROTECTED]> wrote: > I don't want to mix them. But how could I find them? How do I know this > statement can be > potential problem > > if a==b: > > where a and b can be instantiated individually far away from this line of > code that put them > together? if you don't kno

Re: unicode and socket

2005-02-19 Thread Fredrik Lundh
anonymous coward <[EMAIL PROTECTED]> wrote: > It's really funny, I cannot send a unicode stream throuth socket with > python while all the other languages as perl,c and java can do it. Are you sure you understand what Unicode is, and how sockets work? Sockets are used to transfer byte streams.

wxPython 2.5 - bug in wx.Execute

2005-02-19 Thread Andy Leszczynski
Hi, I need a help with following problem which is blocking me quite seriously. I noted some weird behavior on Windows (Python 2.3, wxPython 2.5). The same code works fine under Linux. When using “pid = wx.Execute(cmd, wx.EXEC_ASYNC, self.process)” to spawn new wxPython based GUI program, the GUI

Re: [perl-python] exercise: partition a list by equivalence

2005-02-19 Thread Reinhold Birkenfeld
Xah Lee wrote: > here's the answer to the partition by equivalence exercise. Your Python solution is, as expected, wrong (try with [[10, 8], [7, 3], [1, 7], [5, 4], [2, 2], [3, 8], [7, 10], [2, 3], [6, 10], [3, 2]] for example). The solution by John Lenton is wrong, too. The solution by Brian Be

Re: Probably over my head... Trying to get Font Names

2005-02-19 Thread Samantha
Mike I did get the last msg. Still trying to get things under control. S "Mike C. Fletcher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Samantha wrote: > >>Mike, >>Not sure why that email bounced. >> > That last one bounced too, btw. > >>I downloaded these files: >>WinTTX2.0b

Re: unicode and socket

2005-02-19 Thread aurora
On 18 Feb 2005 19:10:36 -0800, <[EMAIL PROTECTED]> wrote: It's really funny, I cannot send a unicode stream throuth socket with python while all the other languages as perl,c and java can do it. then, how about converting the unicode string to a binary stream? It is possible to send a binary throug

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Ilias Lazaridis
Diez B. Roggisch wrote: Ilias Lazaridis wrote: Diez B. Roggisch wrote: Should a professional developer take python serious? [...] - (ungentle babbling after disrupting coherence of writings) And that from you *lol* Of course. I respect the "coherence of writings" of my conversation partners. [I

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Fredrik Lundh
Ilias Lazaridis wrote: > Should a professional developer take python serious? yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] Python 2.4 Quick Reference available

2005-02-19 Thread Pete Havens
The is awesome! Thanks. I did notice one thing while reading it. In the "File Object" section, it states: "Created with built-in functions open() [preferred] or its alias file()." ...this seems to be the opposite of the Python documentation: "The file() constructor is new in Python 2.2. The prev

Re: unicode encoding usablilty problem

2005-02-19 Thread Alexander Schremmer
On Fri, 18 Feb 2005 21:43:52 +0100, Thomas Heller wrote: >> Eventually, the primary string type should be the Unicode >> string. If you are curious how far we are still off that goal, >> just try running your program with the -U option. > > Not very far - can't even call functions ;-) > def

Re: [ANN] Python 2.4 Quick Reference available

2005-02-19 Thread Franz Steinhäusler
On Sat, 19 Feb 2005 13:00:59 +0100, "Richard Gruet" <[EMAIL PROTECTED]> wrote: >Hi Pythoners, > >An updated version of the Python Quick Reference is available for Python 2.4 >at http://rgruet.free.fr/#QuickRef. >It is a single looonnng html page (30 printed A4 pages) with a choice of 4 >different

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Diez B. Roggisch
Ilias Lazaridis wrote: > Diez B. Roggisch wrote: >>>Should a professional developer take python serious? > [...] - (ungentle babbling after disrupting coherence of writings) And that from you *lol* > I mean, if the team does not manage at least the foundation of a > multi-target automated-bu

On eval and its substitution of globals

2005-02-19 Thread Paddy
Hi, I got tripped up on the way eval works with respect to modules and so wrote a test. It seems that a function carries around knowledge of the globals() present when it was defined. (The .func_globals attribute)? When evaluated using eval(...) the embedded globals can be overridden with the one

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Ilias Lazaridis
Diez B. Roggisch wrote: Should a professional developer take python serious? [...] - (ungentle babbling after disrupting coherence of writings) " Should a professional developer take python serious? I mean, if the team does not manage at least the foundation of a multi-target automated-build-proce

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Diez B. Roggisch
> Unnecessary and deliberately provoking question - python is taken > seriously, e.g. by multi-billion dollar companies like google and zope. Of course zope corporation is not amongst the multi-billion dollar companies - by now. But who knows :) -- Regards, Diez B. Roggisch -- http://mail.pyth

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Diez B. Roggisch
> Should a professional developer take python serious? Unnecessary and deliberately provoking question - python is taken seriously, e.g. by multi-billion dollar companies like google and zope. You OTH have provided no evidence so far that you can be taken seriously as a developer of whatever kind

Re: [ANN] mlabwrap v0.9b3

2005-02-19 Thread Alexander Schmolck
Alexander Schmolck <[EMAIL PROTECTED]> writes: > I'd very much like to hear some feedback (even if it's just "works fine"). Sorry to anyone who got a bounce -- obviously just on the day I write this my email account gets "temporarily deactivated" -- till I sort this out, please send feedback to <

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Ilias Lazaridis
Martin v. Löwis wrote: Ilias Lazaridis wrote: My questions: It appears that nobody has answered the questions, yet. a) Why does the Python Foundation not provide additionally a binary version, compiled with MinGW or another open-source compiler? We don't have the resources to do that. Should a pro

Re: lambda closure question

2005-02-19 Thread Kent Johnson
Ted Lilley wrote: What I want to do is pre-load functions with arguments by iterating through a list like so: class myclass: ...pass def func(self, arg): ...print arg mylist = ["my", "sample", "list"] for item in mylist: ...setattr(myclass, item, lamdba self: func(self, item)) This att

[ANN] mlabwrap v0.9b3

2005-02-19 Thread Alexander Schmolck
I have recently uploaded mlabwrap v0.9b3, a high-level python to matlab(tm) bridge, you can get it from It should work with recent python >=2.3 and matlab(tm) >=6.0; I've used it extensively myself but this is the first announcement to a wider public -- so I'd v

Re: error in non-existing code?

2005-02-19 Thread Thomas Newman
Michael Hoffman wrote: > Thomas Newman wrote: > >> I wanted to look at the code that gives me the error, but there is no >> line 447 in /usr/lib/python2.3/pyclbr.py: > > > Try deleting pyclbr.py[co]. No change there. ttn -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question on python 2.4 and tkinter

2005-02-19 Thread Raymond L. Buvel
David Joyner wrote: Hi: I'm trying to compile python 2.4 with tkinter. (I'm trying to write a gui interface which calls a program called GAP - I'm hoping to use subprocess, a python 2.4 module, since I was getting deadlocks using popen). The instructions at the python web site said basically to edi

Re: duplicate docstrings

2005-02-19 Thread Felix Wiemann
Steven Bethard wrote: > class C(object): > def foo(self): > """Foo things""" > ... > > class D(object): > def foo(self): > """Foo things""" > ... > > It bothers me that I'm basically writing the same docstrings multiple > times. I guess what I really

Re: [ANN] Python 2.4 Quick Reference available

2005-02-19 Thread Robin Becker
Richard Gruet wrote: Hi Pythoners, An updated version of the Python Quick Reference is available for Python 2.4 at http://rgruet.free.fr/#QuickRef. It is a single looonnng html page (30 printed A4 pages) with a choice of 4 different CSS styles; also available in PDF. Richard Great news; thanks and

Re: lambda closure question

2005-02-19 Thread jfj
Carl Banks wrote: jfj wrote: Carl Banks wrote: Ted Lilley wrote: Unfortunately, it doesn't work. It seems the closure keeps track of the variable fed to it dynamically - if the variable changes after [...] At least, that's the explanation I'm deducing from this behavior. And that's the correct ex

[ANN] Python 2.4 Quick Reference available

2005-02-19 Thread Richard Gruet
Hi Pythoners, An updated version of the Python Quick Reference is available for Python 2.4 at http://rgruet.free.fr/#QuickRef. It is a single looonnng html page (30 printed A4 pages) with a choice of 4 different CSS styles; also available in PDF. Richard -- http://mail.python.org/mailman/listi

[perl-python] exercise: partition a list by equivalence

2005-02-19 Thread Xah Lee
here's the answer to the partition by equivalence exercise. --- # Perl code sub merge($) { my @pairings = @{$_[0]}; my @interm; # array of hashs # chop the first value of @pairings into @interm $interm[0]={$pairings[0][0]=>'x'}; ${interm[0]}{$pairings[0]

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread "Martin v. Löwis"
Ilias Lazaridis wrote: My questions: It appears that nobody has answered the questions, yet. a) Why does the Python Foundation not provide additionally a binary version, compiled with MinGW or another open-source compiler? We don't have the resources to do that. b) Why does the Python Foundation n

Re: Access to formatting controls from within __repr__ or __str__?

2005-02-19 Thread Serge Orlov
Dan Sommers wrote: > On 18 Feb 2005 01:25:06 -0800, > "Serge Orlov" <[EMAIL PROTECTED]> wrote: > >> Dan Sommers wrote: > >>> So my question is: Is there a way to pass options "through" a >>> format string to the __str__ and __repr__ functions? For example, >>> can I define my own alternate form f

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-19 Thread Ilias Lazaridis
A.B., Khalid wrote: Ilias Lazaridis wrote: The first step is to make a pyMinGW project. You are mistaken. The first steps are the following: [...] - (nonrelevant comments) 3) Realizing that there _is_ already a project called pyMinGW! That it does not fit your requirements-- whatever these maybe--

Re: unicode and socket

2005-02-19 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > It's really funny, I cannot send a unicode stream throuth socket with > python while all the other languages as perl,c and java can do it. You may really start laughing loudly after you find out that you can send arbitrary python objects over sockets. If you want langu

Re: Can I get message filename from a Maildir mailbox stream?

2005-02-19 Thread Michael Josephson
>a way to figure out what filename an email object points to in a >qmail style Maildir directory? Assuming you're using the mailbox module from the standard Python library, the Message objects you get back provide access to the file object as an instance variable called fp. So if you have: maild

Re: duplicate docstrings

2005-02-19 Thread Brian van den Broek
Steven Bethard said unto the world upon 2005-02-18 13:58: I have two classes that implement the same interface, e.g. something like: class C(object): def foo(self): """Foo things""" ... def bar(self): """Bar things""" ... def baz(self): """Baz thi

Re: lambda closure question

2005-02-19 Thread Carl Banks
jfj wrote: > Carl Banks wrote: > > Ted Lilley wrote: > > > > > >>Unfortunately, it doesn't work. It seems the closure keeps track of > >>the variable fed to it dynamically - if the variable changes after > > [...] > >> > >>At least, that's the explanation I'm deducing from this behavior. > > > >

Re: Chart Director?

2005-02-19 Thread km
Hi all, Chart Director is a good module to implement graphs using in python. i have been using it since 6 months for scientific data visualisation. great module !!! regards, KM -- On Sat, Feb 19, 2005 at 08:22:19AM +0100, Vincent Wehren wrote:

Re: Can I get message filename from a Maildir mailbox stream?

2005-02-19 Thread Phil Jackson
[EMAIL PROTECTED] writes: > Is there a way to figure out what filename an email object points to > in a qmail style Maildir directory? What do you mean bu "email object"? Surely if you are iterating a Maildir then you should have the filename. Or am I misunderstanding what you mean? Phil -- htt

±M·~ºô­¶±H¦sªA°È ¦P¨B¤ä´© PHP+MySQL, Access+ASP, ASP.NET, CGI, SSI ¹q¶l¯f¬r¹LÂo, ©U§£¹q¶l¹LÂo ¤ÎWebMail ..............................................................................................................................................................................................................................................................................................

2005-02-19 Thread dummyboy
©Ò¦³¦b¥»¤ë§C«e¥Ó½Ðªº¨ä¥¦¤½¥qÂಾ«È¤á§Y¦h°e±z¤T­Ó¤ëªA°È ¤ä´© PHP+MySQL, Access+ASP, ASP.NET, CGI, SSI ¹q¶l¯f¬r¹LÂo, ©U§£¹q¶l¹LÂo ¤Î WebMail µ¥.. ¥»¤ë§C«e¥Ó½ÐW1000§Y°e­º¦¸¦w¸ËÁʪ«¨®µ{¦¡ osc. http://shop2.uhostnet.com ¨C¤ë¥u»Ý $20 °_ ­º­¶ http://www.uhostnet.com ·s«È¤á¶}³q¼ËªO http://dummy.uhos

Re: re.compile and very specific searches

2005-02-19 Thread Denis S. Otkidach
On Fri, 18 Feb 2005 13:14:28 -0500 rbt <[EMAIL PROTECTED]> wrote: > Is it possible to use re.compile to exclude certain numbers? For > example, this will find IP addresses: > > ip = re.compile('\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}') > > But it will also find 999.999.999.999 (something which could no

Re: lambda closure question

2005-02-19 Thread jfj
Carl Banks wrote: Ted Lilley wrote: Unfortunately, it doesn't work. It seems the closure keeps track of the variable fed to it dynamically - if the variable changes after [...] At least, that's the explanation I'm deducing from this behavior. And that's the correct explanation, chief. It is in

¤Ñ¤ô³ò¤Ñ´I­b²Ä¤@®y³æ¦ì¤À¯²..............................................................................................................................................................................................................................................................................................

2005-02-19 Thread noreplyme
[EMAIL PROTECTED] ´N¦b¹|´I°Ó³õ³ÄÃä ªþªñ¥æ³qª½³q¦U­«­n¦a°Ï »´ÅK¦èÅK¥þ³¡´N¸} [EMAIL PROTECTED] [EMAIL PROTECTED] ©Ð¶¡¦³§N®ð¾÷ [EMAIL PROTECTED],­±¦V¤½¶é ¥þ«Î­±¿n¬ù¤K¦Ê¤Ø,©Ð¶¡¬ù100¤Ø ¹q±èª½¨ì¤G¤Q¤C¼Ó ¯²ª÷¤G¤d¤¸ http://www.geocities.com/tinfucourt/tinfu_plan.html ¤T©Ð¤GÆU³æ¦ì¥­­±¹Ï (plan 2) ¥u­­³æ¨­

Re: lambda closure question

2005-02-19 Thread Carl Banks
Ted Lilley wrote: > What I want to do is pre-load functions with arguments by iterating > through a list like so: > > >>>class myclass: > ...pass > >>>def func(self, arg): > ...print arg > >>>mylist = ["my", "sample", "list"] > >>>for item in mylist: > ...setattr(myclass, item, lamdba s