Arlington VA Python sprint

2006-09-22 Thread A.M. Kuchling
A note to Washington DC-area Python people: the Arlington sprint will be held tomorrow, Saturday the 23rd, at the Arlington Career Center. Directions are in the wiki at http://wiki.python.org/moin/ArlingtonSprint. --amk -- http://mail.python.org/mailman/listinfo/python-announce-list

PyCon 2007 submission now open

2006-09-22 Thread A.M. Kuchling
The web application for submitting proposals to PyCon 2007 is now available at http://us.pycon.org/apps07/proposals/, so you can now send in your talk ideas. The deadline for submitting a proposal is October 31st. For more information, see the Call For Proposals at

ANN: DBUtils 0.9.2 has been released

2006-09-22 Thread Christoph Zwerschke
DBUtils 0.9.2 has been released. DBUtils is a suite of tools providing solid, persistent and pooled connections to a database that can be used in all kinds of multi-threaded environments such as Webware for Python or other web application servers. The suite supports DB-API 2 compliant database

Re: Using py2exe to wrap a service?

2006-09-22 Thread MaR
CONCLUSION: Tim Golden sent me a patched version of his active_directory.py ver 0.4 and that solved my problem! Thanks all for your attention and in particular, Tim! //Maria 111a112 from win32com.client.gencache import EnsureDispatch 180c181 _connection = Dispatch (ADODB.Connection) ---

Re: How does IPython modify the sys.path?

2006-09-22 Thread Robert Kern
Daniel Mark wrote: So how dos IPython modify my sys.path without trace??? sys.path.append() Specifically, line 321 of ipmaker.py -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as

Re: Is it possible to save a running program and reload next time ?

2006-09-22 Thread [EMAIL PROTECTED]
Hans Georg Krauthaeuser wrote: [EMAIL PROTECTED] wrote: Can objects be saved and reloaded by Pickle ? I have tried but no success. Yes, that's the intended use of pickle/cPickle. There are examples in the docs: http://docs.python.org/lib/module-pickle.html What have you tried

Re: How does IPython modify the sys.path?

2006-09-22 Thread Fredrik Lundh
Daniel Mark wrote: However, I cannot figure out how IPython can change my sys.path. I refer to all the following sources 1 http://www.python.org/doc/current/inst/search-path.html Installing Python Modules 2 KEY_LOCAL_MACHINE\Software\Python\PythonCore\2.4\PythonPath 3 My machine has no

Re: Is it possible to save a running program and reload next time ?

2006-09-22 Thread Hans Georg Krauthaeuser
[EMAIL PROTECTED] wrote: Hans Georg Krauthaeuser wrote: [EMAIL PROTECTED] wrote: Can objects be saved and reloaded by Pickle ? I have tried but no success. Yes, that's the intended use of pickle/cPickle. There are examples in the docs:

Help with JPEG support with PIL 1.1.5 and OSX

2006-09-22 Thread Jack Wu
Hi I've spent a good majority of my day trying to figure out how to have PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I have not gotten anywhere. Could somebody please help me... I've scoured all the documentation, google, and mailing lists to no avail. I believe the

Re: How to return an not string' error in function?

2006-09-22 Thread Camellia
I've learned a lot from you two, thank you:) Peace -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils on Windows with VC++ 8

2006-09-22 Thread Rob Williscroft
Martin v. Löwis wrote in news:[EMAIL PROTECTED] in comp.lang.python: [EMAIL PROTECTED] schrieb: I'm trying to install two different packages which wrap C or C++ code and which make use of distutils.build_ext, which barfs because my only compiler is too new. Trying this both on Python 2.4.3

Re: Strange behaviour of 'is'

2006-09-22 Thread Duncan Booth
Steve Holden [EMAIL PROTECTED] wrote: Absolutely correct. It would be more interesting to discuss how the output from these statements varied between (say) CPython, Jython and Iron Python. At the moment the discussion is indeed about insignificant implementation trivia. CPython seems to

Re: Can I inherit member variables?

2006-09-22 Thread LorcanM
Thanks Bruno, That is a more natural way to do it. The code looks a lot cleaner now. Lorcan. -- http://mail.python.org/mailman/listinfo/python-list

Re: new string method in 2.5 (partition)

2006-09-22 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Gabriel Genellina wrote: ... a python string has both a length *and* a null terminator (for ease of interfacing C routines ... How does that work for strings with embedded nulls? Or are the C routines simply fooled into seeing a truncated part of the string? --

what is the best practice to separate Pygtk and long running thread code

2006-09-22 Thread seb
Hi, I am using pygtk for the first times. I am wondering what would be the best pattern to interface pygtk with a thread. The thread is collecting informations (over the network for example) or is doing some long calculations. I would like also to separate the gui part to the action part so

Re: new string method in 2.5 (partition)

2006-09-22 Thread Duncan Booth
Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: In message [EMAIL PROTECTED], Gabriel Genellina wrote: ... a python string has both a length *and* a null terminator (for ease of interfacing C routines ... How does that work for strings with embedded nulls? Or are the C routines simply

Re: I need some help with a regexp please

2006-09-22 Thread Ant
John Machin wrote: ... A little more is unfortunately not enough. The best advice you got was to use an existing e-mail address validator. We got bitten by this at the last place I worked - we were using a regex email validator (from Microsoft IIRC), and we kept having problems with specific

Re: Python and CORBA

2006-09-22 Thread Eric Brunel
On Thu, 21 Sep 2006 15:11:07 +0200, Diez B. Roggisch [EMAIL PROTECTED] wrote: AFAIK Fnorb also had license issues - I'm not entirely sure of that, but better check it. The earlier versions seem to have been somewhat proprietary, but the latest one should be as free as Python is. Extract

Re: Don't use regular expressions to validate email addresses (was: I need some help with a regexp please)

2006-09-22 Thread Ant
Ben Finney wrote: ... The best advice I've seen when people ask How do I validate whether an email address is valid? was Try sending mail to it. There are advantages to the regex method. It is faster than sending an email and getting a positive or negative return code. The delay may not be

Re: Don't use regular expressions to validate email addresses (was: Ineed some help with a regexp please)

2006-09-22 Thread Bruno Desthuilliers
bruce wrote: so ben... if you were creating a web app with an email form... rather than try to check if the email is valid... Ever bothered to read the relevant rfc ? you'd create something to allow anyone to potentially spam the hell out of a system... I'm sorry, but I fail to see how

Re: Don't use regular expressions to validate email addresses

2006-09-22 Thread John Machin
Ben Finney wrote: Steve Holden [EMAIL PROTECTED] writes: Ben Finney wrote: The best advice I've seen when people ask How do I validate whether an email address is valid? was Try sending mail to it. That only applies if it's a likely-looking email address. If someone asks me to

Re: Don't use regular expressions to validate email addresses (was:Ineed some help with a regexp please)

2006-09-22 Thread Fredrik Lundh
Bruno Desthuilliers wrote: if you were creating a web app with an email form... rather than try to check if the email is valid... Ever bothered to read the relevant rfc ? or the perl faq: http://faq.perl.org/perlfaq9.html#How_do_I_check_a_val /F --

Re: I need some help with a regexp please

2006-09-22 Thread John Machin
Ant wrote: John Machin wrote: ... A little more is unfortunately not enough. The best advice you got was to use an existing e-mail address validator. We got bitten by this at the last place I worked - we were using a regex email validator (from Microsoft IIRC), and we kept having

Re: Building things with setup.py

2006-09-22 Thread James Stroud
Robert Kern wrote: James Stroud wrote: I did build my own python 2.5, yesterday, requiring me to rebuild all extensions. Do other extensions build correctly? If so, it's beginning to look like a problem in numpy.distutils . It seems that every thing has built without incident (numarray,

Re: Building things with setup.py

2006-09-22 Thread James Stroud
Martin v. Löwis wrote: James Stroud schrieb: This is annoying. I am trying to build scipy right now but every .so file requires my adding -lpython2.5 -lpthread -lm -lutil -ldl -shared to the ld flags. That shouldn't be necessary. Linking without this should work just fine. Unfortunately,

Re: Can I inherit member variables?

2006-09-22 Thread Bruno Desthuilliers
Gabriel Genellina wrote: At Thursday 21/9/2006 09:14, Bruno Desthuilliers wrote: When you construct an object instance, it is of a certain type from that precise moment, and you can't change that afterwards. Err... Actually, in Python, you can. It's even a no-brainer. Yes, but trying

Re: Tkinter button not working as expected

2006-09-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I've created a short test program that uses tkFileDialog.askdirectory to help the user input a path into a tk entry widget. The problem I'm having is that when I run the code as listed below, the getPath function is called when the program initially runs, not when

Re: Is it possible to save a running program and reload next time ?

2006-09-22 Thread [EMAIL PROTECTED]
Hans Georg Krauthaeuser wrote: [EMAIL PROTECTED] wrote: Hans Georg Krauthaeuser wrote: [EMAIL PROTECTED] wrote: Can objects be saved and reloaded by Pickle ? I have tried but no success. Yes, that's the intended use of pickle/cPickle. There are

Re: Don't use regular expressions to validate email addresses

2006-09-22 Thread Ben Finney
John Machin [EMAIL PROTECTED] writes: What proportion of deliverable e-mail addresses have more than one @ in them? I don't know. Fortunately, I don't need to; I don't validate email addresses by regular expression. What proportion of deliverable email addresses do you want to discard as not

Re: Building things with setup.py

2006-09-22 Thread James Stroud
Robert Kern wrote: James Stroud wrote: I did build my own python 2.5, yesterday, requiring me to rebuild all extensions. Do other extensions build correctly? If so, it's beginning to look like a problem in numpy.distutils . Actually, I just found that MySQLdb had a similar problem with

Re: Don't use regular expressions to validate email addresses

2006-09-22 Thread John Machin
Ben Finney wrote: John Machin [EMAIL PROTECTED] writes: What proportion of deliverable e-mail addresses have more than one @ in them? I don't know. Fortunately, I don't need to; I don't validate email addresses by regular expression. What proportion of deliverable email addresses do

Re: Is it possible to save a running program and reload next time ?

2006-09-22 Thread Peter Otten
[EMAIL PROTECTED] wrote: Can the state of the random value generator be saved ? Yes. You can pickle random._inst or your own random.Random instance. Peter -- http://mail.python.org/mailman/listinfo/python-list

CONSTRUCT - New/Old Style Classes, build-in/extension types

2006-09-22 Thread Ilias Lazaridis
Another topic [1] has raised the need of a deeper teach-in. Where can I find _compact_ documentation about * Differece between New Style / Old Style Classes Are there any documents available (again: compact ones) which describe unification attemps subjecting * New Style Classes * Old Style

Re: byte count unicode string

2006-09-22 Thread Paul Rubin
willie [EMAIL PROTECTED] writes: ustr = buf.decode('UTF-8') type(ustr) type 'unicode' Is it a unicode object that contains a UTF-8 encoded string object? No, it's just unicode, which is a string over a certain character set. UTF-8 is a way to encode unicode strings as byte strings. You

Re: CONSTRUCT - New/Old Style Classes, build-in/extension types

2006-09-22 Thread Fredrik Lundh
Ilias Lazaridis wrote: note: I am aware about search engines. but you're incapable of using them, or ? I ask for documentation which other developers have found useful most recent Python books contains good discussions of the things you're asking for. maybe you should buy a book ? /F

Re: CONSTRUCT - New/Old Style Classes, build-in/extension types

2006-09-22 Thread Ben Finney
Ilias Lazaridis [EMAIL PROTECTED] writes: Where can I find _compact_ documentation about Can you tell us what is lacking about the documentation at URL:http://www.python.org/doc/ ? Specifically, what problems have you found in understanding these topics from the documentation available at that

Re: distutils on Windows with VC++ 8

2006-09-22 Thread NoelByron
I use the Visual C++ Toolkit 2003 to compile Python extension for Python 2.4. Once installed, it works well. With and without distutils. I also have a installation of Visual Studio 2005 on the same machine. See: http://www.vrplumber.com/programming/mstoolkit/ for more information. There are a

Re: Don't use regular expressions to validate email addresses (was: Ineed some help with a regexp please)

2006-09-22 Thread Damjan
you'd create something to allow anyone to potentially spam the hell out of a system... I'm sorry, but I fail to see how validating (or not) an email address could prevent using a webmail form for spamming. Care to elaborate ? The best way would be to implement some limiting features. Try

Re[2]: unicode mystery/problem

2006-09-22 Thread Petr Jakeš
John, thanks for your extensive answer. Hi, I am using Python 2.4.3 on Fedora Core4 and Eric3 Python IDE . Below mentioned code works fine in the Eric3 environment. While trying to start it from the command line, it returns: Traceback (most recent call last): File pokus_1.py, line 5, in

Re: Don't use regular expressions to validate email addresses

2006-09-22 Thread Steve Holden
Ben Finney wrote: John Machin [EMAIL PROTECTED] writes: What proportion of deliverable e-mail addresses have more than one @ in them? I don't know. Fortunately, I don't need to; I don't validate email addresses by regular expression. What proportion of deliverable email addresses do

Re: Strange behaviour of 'is'

2006-09-22 Thread Steve Holden
Duncan Booth wrote: Steve Holden [EMAIL PROTECTED] wrote: Absolutely correct. It would be more interesting to discuss how the output from these statements varied between (say) CPython, Jython and Iron Python. At the moment the discussion is indeed about insignificant implementation trivia.

Re: I need some help with a regexp please

2006-09-22 Thread Ant
John Machin wrote: Ant wrote: John Machin wrote: ... A little more is unfortunately not enough. The best advice you got was to use an existing e-mail address validator. We got bitten by this at the last place I worked - we were using a regex email validator (from Microsoft IIRC)

Re: send with timeout socket

2006-09-22 Thread Steve Holden
Stéphane Ninin wrote: Hello, I have a few questions regarding sockets with timeouts. Assuming you set a timeout t on a socket s and then call: 1) s.sendall Is the socket.timeout exception thrown when not the data was sent in the given time t or if nothing was sent ? 2) Similar

noob question

2006-09-22 Thread xandeer
where is a good open-source project website? thank-you (sorry for being so annoying)(if I'm annoying)(if not then I'm not sorry) -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing Video conference software for Windows

2006-09-22 Thread Paolo Pantaleo
Thnx everybody for the precious help :) Someone said about VNC... I'll take a look, but since it is an exercise I need to do it, I can't just say someone else arelady did that :) Everything seems quite useful. I forgot two specifications: 1. Screen should be split in small squares and only the

Re: what is the best practice to separate Pygtk and long running thread code

2006-09-22 Thread Thomas Guettler
seb wrote: Hi, I am using pygtk for the first times. I am wondering what would be the best pattern to interface pygtk with a thread. The thread is collecting informations (over the network for example) or is doing some long calculations. Hi, I would use several *processes*. If your

Secure MultiRobot Management

2006-09-22 Thread Raja
Hi, I am currently doing my final year project Secure mobile Robot Management . I have done the theoretical aspects of it till now and now thinking of coding it . I would like to code in Python , but i am new to Python Network Programming . Some of features of my project are: 1. Each robot

Python Network Programming

2006-09-22 Thread Raja Rokkam
Hi, I am currently doing my final year project Secure mobile Robot Management . I have done the theoretical aspects of it till now and now thinking of coding it .I would like to code in Python , but i am new to Python Network Programming . Some of features of my project are: 1. Each robot can

Re: Python Threading

2006-09-22 Thread Bryan Olson
Calvin Spealman wrote: I repeat this all the time, but the best advice I can give you about using threads is to not use threads at all. Might as well get with the times and ignore that advice. I would point you to good references like Threads Considered Harmful

bulding python containing static extension

2006-09-22 Thread hobel
Hi, I want to build python on a plattform without dynamic linking containing a third party extension, is this possible? Bulding python itself is no problem, with the proper Modules/Setup configuration. But does anybody know how to integrate e.g. numpy as well? Is it possible? Any

Re: Re[2]: unicode mystery/problem

2006-09-22 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Petr Jakeš wrote: I have try to experiment with the code a bit. the simplest code where I can demonstrate my problems: #!/usr/bin python import sys print default, sys.getdefaultencoding() print stdout, sys.stdout.encoding a=['P\xc5\x99\xc3\xad','Petr

Re: noob question

2006-09-22 Thread John Salerno
xandeer wrote: where is a good open-source project website? thank-you (sorry for being so annoying)(if I'm annoying)(if not then I'm not sorry) sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Directory this source file is in (and a sibling)

2006-09-22 Thread Sion Arrowsmith
I have a module which needs to know what directory it's in, and to refer to files in a sibling directory, something like App/src/foo.py wants to read App/data/conf.xml . But I have no idea in what context foo.py is going to be run -- it could be being run as a script, it could be being imported as

Isn't bool __invert__ behaviour strange?

2006-09-22 Thread Saizan
Why subclassing bool from int either __invert__ or __neg__ haven't been overrided to produce a boolean negation? I suspect backwards compatibility or something alike, but I still wonder.. And since bool can't be subclassed, to have a type like bool but with boolean negation what do you suggest? A

Re: Re[2]: unicode mystery/problem

2006-09-22 Thread John Machin
Petr Jakeš wrote: John, thanks for your extensive answer. Hi, I am using Python 2.4.3 on Fedora Core4 and Eric3 Python IDE . Below mentioned code works fine in the Eric3 environment. While trying to start it from the command line, it returns: Traceback (most recent call last):

anybody using python 2.5 that raises error while importing?

2006-09-22 Thread daniel
there's a dll extension used to be imported with no error under version 2.4.3, but the new python complains that the name of the module can't be found. seems not mentioned in the official documentation, any work around to fix the issue without switching back to the old version? tks.. daniel --

Re: Directory this source file is in (and a sibling)

2006-09-22 Thread John Machin
Sion Arrowsmith wrote: I have a module which needs to know what directory it's in, and to refer to files in a sibling directory, something like App/src/foo.py wants to read App/data/conf.xml . But I have no idea in what context foo.py is going to be run -- it could be being run as a script,

Re: Writing Video conference software for Windows

2006-09-22 Thread Paolo Pantaleo
2006/9/22, Paolo Pantaleo [EMAIL PROTECTED]: Thnx everybody for the precious help :) Someone said about VNC... I'll take a look, but since it is an exercise I need to do it, I can't just say someone else arelady did that :) Everything seems quite useful. I forgot two specifications: 1.

Re: anybody using python 2.5 that raises error while importing?

2006-09-22 Thread John Machin
daniel wrote: there's a dll extension used to be imported with no error under version 2.4.3, but the new python complains that the name of the module can't be found. seems not mentioned in the official documentation, any work around to fix the issue without switching back to the old version?

Re: Don't use regular expressions to validate email addresses

2006-09-22 Thread Tim Williams
Just as a matter of interest, are you expecting that you'll find out about the undeliverable ones? Because in many cases nowadays you wont, since so many domains are filtering out undeliverable mail messages as an anti-spam defence. ...and then there is the problem of validating that the

Re: Python 2.5 WinXP AMD64

2006-09-22 Thread Bryan Olson
Bjoern Schliessmann wrote: Christophe wrote: To be exact, you need a 64bit Windows OS on a 64bit cpu. Is there a reason that can be explained in a less-than-2-KB posting? :) I mean why Python depends on the processor type that much. The 64-bit version of Python is compiled for 64-bit

Re: Writing Video conference software for Windows

2006-09-22 Thread Ravi Teja
Someone said about VNC... I'll take a look, but since it is an exercise I need to do it, Exercises typically need you to implement, not invent (leave that for a thesis or a dissertation). Rather than invent VNC, you could just implement it on your own from the specs.

Re: CONSTRUCT - New/Old Style Classes, build-in/extension types

2006-09-22 Thread Ilias Lazaridis
Ben Finney wrote: Ilias Lazaridis [EMAIL PROTECTED] writes: Where can I find _compact_ documentation about Can you tell us what is lacking about the documentation at URL:http://www.python.org/doc/ ? Specifically, what problems have you found in understanding these topics from the

Re: send with timeout socket

2006-09-22 Thread Bryan Olson
Stéphane Ninin wrote: I have a few questions regarding sockets with timeouts. Assuming you set a timeout t on a socket s and then call: 1) s.sendall Is the socket.timeout exception thrown when not the data was sent in the given time t or if nothing was sent ? Neither; not exactly

Does Python provide Struct data structure?

2006-09-22 Thread Daniel Mark
Hello all: I have found a useful module in IPython, named 'from IPython.ipstruct import Struct. So I can use it as follows: from IPython.ipstruct import Struct mystruct = Struct(echo = 1, verb = 'Verbose', filedir

Re: Isn't bool __invert__ behaviour strange?

2006-09-22 Thread Bjoern Schliessmann
Saizan wrote: Why subclassing bool from int either __invert__ or __neg__ haven't been overrided to produce a boolean negation? I wonder what -True or -False should evaluate to. Regards, Björn -- BOFH excuse #297: Too many interrupts --

Re: Python 2.5 WinXP AMD64

2006-09-22 Thread Bjoern Schliessmann
Bryan Olson wrote: The O.P. has a 64-bit Athlon processor, but is running a 32-bit OS. The processor emulates its 32-bit predecessor in legacy mode, so 32-bit software runs. Ah, of course. Thanks for all replies! :) Regards, Björn -- BOFH excuse #13: we're waiting for [the phone

Re: Does Python provide Struct data structure?

2006-09-22 Thread jay graves
Daniel Mark wrote: I have found a useful module in IPython, named 'from IPython.ipstruct import Struct. So I can use it as follows: from IPython.ipstruct import Struct mystruct = Struct(echo = 1, verb = 'Verbose',

Re: send with timeout socket

2006-09-22 Thread Bryan Olson
Stéphane Ninin wrote: Yes, I typed it *really* too fast, it would be more something like this: def sendall(self, data): while data: try: n = self.request.send(data) data = data[n:] except socket.timeout, e:

overrideredirect and Text widget

2006-09-22 Thread Sorin Schwimmer
Hi again,Last afternoon I posted a question regarding the loss of keyboard in an undecorated window. Last night I tried again, at home, and the same code worked fine. The difference: it failed under (Gentoo) Linux, it succeeded under Win 2000, both running Python 2.4.x.So, I guess, my question now

Global module variables as default parameters

2006-09-22 Thread Christoph Haas
Hi, list... I wondered if it's possible to use global (module) variables as default parameters. A simple working example: #!/usr/bin/python globalvar = 123 def test(foo=globalvar): print foo test() Running

Anyone use PyPar (Python MPI implementation) recently?

2006-09-22 Thread [EMAIL PROTECTED]
Has anyone used PyPar ( http://datamining.anu.edu.au/~ole/pypar/ ) recently? I _do_ want to do MPI (not BSP) but I don't need any advanced MPI things... and PyPar seemed just up my ally... but alas it doesn't compile: ### [umbriel][~/download/pypar_1_9_2] python setup.py

Re: CONSTRUCT - New/Old Style Classes, build-in/extension types

2006-09-22 Thread Ilias Lazaridis
Fredrik Lundh wrote: Ilias Lazaridis wrote: note: I am aware about search engines. but you're incapable of using them, or ? - I ask for documentation which other developers have found useful most recent Python books contains good discussions of the things you're asking for. maybe

I need some help with a regexp please

2006-09-22 Thread Sorin Schwimmer
Hi,My $0.02:re.compile('^\w+([\.-]?\w+)[EMAIL PROTECTED]([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|intl|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$')I picked it up from the Net, and while it may be not perfect (you've got lots of reply's telling you why),it's good enough for me.Good luck,Sorin--

Re: Global module variables as default parameters

2006-09-22 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Christoph Haas wrote: TestModule.py globalvar = 0 def def1(): print globalvar def def2(foo=globalvar): print foo Running the test.py script prints 123 and 0. So accessing the

Re: Isn't bool __invert__ behaviour strange?

2006-09-22 Thread Saizan
Bjoern Schliessmann wrote: Saizan wrote: Why subclassing bool from int either __invert__ or __neg__ haven't been overrided to produce a boolean negation? I wonder what -True or -False should evaluate to. Regards, Björn -- BOFH excuse #297: Too many interrupts Well in boolean

Re: Global module variables as default parameters

2006-09-22 Thread Peter Otten
Christoph Haas wrote: Hi, list... I wondered if it's possible to use global (module) variables as default parameters. A simple working example: #!/usr/bin/python globalvar = 123 def test(foo=globalvar): print foo test()

Re: Isn't bool __invert__ behaviour strange?

2006-09-22 Thread John Roth
Saizan wrote: Why subclassing bool from int either __invert__ or __neg__ haven't been overrided to produce a boolean negation? I suspect backwards compatibility or something alike, but I still wonder.. And since bool can't be subclassed, to have a type like bool but with boolean negation

Re: Anyone use PyPar (Python MPI implementation) recently?

2006-09-22 Thread [EMAIL PROTECTED]
Nevermind... I'm an idiot... just didn't specify the right options... python setup.py install --prefix=$MY_PREFIX Works just fine... sigh. Friedmud -- http://mail.python.org/mailman/listinfo/python-list

XML parser that sorts elements?

2006-09-22 Thread jmike
Hi everyone, I am a total newbie to XML parsing. I've written a couple of toy examples under the instruction of tutorials available on the web. The problem I want to solve is this. I have an XML snippet (in a string) that looks like this: booga foo=1 bar=2 wellhello/well blahgoodbye/blah

Re: CONSTRUCT - New/Old Style Classes, build-in/extension types

2006-09-22 Thread Steve Holden
Ilias Lazaridis wrote: Fredrik Lundh wrote: Ilias Lazaridis wrote: note: I am aware about search engines. but you're incapable of using them, or ? - I ask for documentation which other developers have found useful most recent Python books contains good discussions of the things

Re: Isn't bool __invert__ behaviour strange?

2006-09-22 Thread Carsten Haese
On Fri, 2006-09-22 at 11:25, Saizan wrote: Bjoern Schliessmann wrote: Saizan wrote: Why subclassing bool from int either __invert__ or __neg__ haven't been overrided to produce a boolean negation? I wonder what -True or -False should evaluate to. Well in boolean notation -True ==

Re: XML parser that sorts elements?

2006-09-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Hi everyone, I am a total newbie to XML parsing. I've written a couple of toy examples under the instruction of tutorials available on the web. The problem I want to solve is this. I have an XML snippet (in a string) that looks like this: booga foo=1 bar=2

Re: Does Python provide Struct data structure?

2006-09-22 Thread Bjoern Schliessmann
Daniel Mark wrote: I have two following questions: 1 Does Python provide such Struct in this standard libary. Python has 4.3 struct -- Interpret strings as packed binary data, but it looks like different from what I really want to get. Yes, that module is used when you want to deal with C

Re: CONSTRUCT - New/Old Style Classes, build-in/extension types

2006-09-22 Thread Paul Boddie
Ilias Lazaridis wrote: Fredrik Lundh wrote: Ilias Lazaridis wrote: note: I am aware about search engines. but you're incapable of using them, or ? Well, Python new-style old-style classes in Google gives a range of discussions, but an old version of the definitive guide [1] is found

Re: what is the best practice to separate Pygtk and long running thread code

2006-09-22 Thread seb
Hi Thomas, I am running WinXP so that casting processes and getting their results is not so convenient. I have tested idle add and it does the job : the thread is running whenever there is no activity on the gui. I still do not understand how it can be so responsive 'cause the thread I am using

Re: Isn't bool __invert__ behaviour strange?

2006-09-22 Thread Bjoern Schliessmann
Saizan wrote: Well in boolean notation -True == False and -False == True, actually you may prefer ¬ or a line over the term, (I can't remember reading - (minus) for a standard boolean negation operator anywhere. Even C/C++ uses !.) but since there's no such operator in python I think we

Re: Python programs always open source?

2006-09-22 Thread Magnus Lycka
Ben Finney wrote: Leif K-Brooks [EMAIL PROTECTED] writes: Ben Finney wrote: So long as you're not distributing some or all of Python itself, or a derivative work, the license for Python has no legal effect on what license you choose for your own work. I was replying to Ben Finney's claim

Question about the article py2exe compiler in Python Cookbook by Alexander Semenov

2006-09-22 Thread Daniel Mark
Hello all: I follow the following tutorial http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/108598 Description: script for making executables with py2exe ## from distutils.core import setup import sys, os, py2exe name = sys.argv[1] sys.argv[1] = 'py2exe'

Re: XML parser that sorts elements?

2006-09-22 Thread jmike
Diez B. Roggisch wrote: You can sort them by obtaining them as tree of nodes, e.g. using element tree or minidom. But you should be aware that this will change the structure of your document and it isn't always desirable to do so - e.g. html pages would look funny to say the least if

Re: XML parser that sorts elements?

2006-09-22 Thread Paul McGuire
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi everyone, I am a total newbie to XML parsing. I've written a couple of toy examples under the instruction of tutorials available on the web. The problem I want to solve is this. I have an XML snippet (in a string) that looks

Re: XML parser that sorts elements?

2006-09-22 Thread jmike
Paul McGuire wrote: ... Here is a snippet from an interactive Python session, working with the batteries included xml.dom.minidom. The solution is not necessarily in the parser, it may be instead in what you do with the parsed document object. This is not a solution to your actual

Re: Isn't bool __invert__ behaviour strange?

2006-09-22 Thread Saizan
John Roth wrote: The not operator and the bool() builtin produce boolean results. Since bool is a subclass of int, all the integer operations will remain integer operations. This was done for backwards compatability, and is unlikely to change in the 2.x series. Ok, shame on me, I

Re: XML parser that sorts elements?

2006-09-22 Thread Paul McGuire
Paul McGuire [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] snip This is what I posted, but it's not what I typed. I entered some very long lines at the console, and the newsgroup software, when wrapping the text,

Re: Python programs always open source?

2006-09-22 Thread Steve Holden
Magnus Lycka wrote: Ben Finney wrote: Leif K-Brooks [EMAIL PROTECTED] writes: Ben Finney wrote: So long as you're not distributing some or all of Python itself, or a derivative work, the license for Python has no legal effect on what license you choose for your own work. I was replying to

Re: Isn't bool __invert__ behaviour strange?

2006-09-22 Thread Bjoern Schliessmann
Saizan wrote: (However (not x) whould be as annoying as 1-x even if a little more readable (if you consider lispish parentheses readable): Input expression: (not (not x)(not y)!(not (z|v))) Did you notice that you use bitwise AND and OR here? How about not (not x) and (not y) or (not (z or

Re: CONSTRUCT - New/Old Style Classes, build-in/extension types

2006-09-22 Thread Steve Holden
Paul Boddie wrote: Ilias Lazaridis wrote: [...] Have those old style classes any benefits? That you don't have to write the bizarre conceptual accident that is (object) when declaring a top-level class? Though of course the easiest way to enforce your classes to new style is to begin

Re: Question about the article py2exe compiler in Python Cookbook by Alexander Semenov

2006-09-22 Thread Thomas Heller
Daniel Mark schrieb: Hello all: I follow the following tutorial http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/108598 Description: script for making executables with py2exe ## from distutils.core import setup import sys, os, py2exe name = sys.argv[1]

+1 QOTW

2006-09-22 Thread olsongt
Did anyone else crack up when Larry Wall described python with the statement: Python, as the anti-Perl, is heavily invested in maintaining Order. In the state of the onion address? http://www.perl.com/pub/a/2006/09/21/onion.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Isn't bool __invert__ behaviour strange?

2006-09-22 Thread Paul McGuire
Saizan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] John Roth wrote: The not operator and the bool() builtin produce boolean results. Since bool is a subclass of int, all the integer operations will remain integer operations. This was done for backwards compatability, and is

  1   2   3   >