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

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

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 t

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

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 b

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

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 som

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 -- http://mail.python.org/mailma

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 (num

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. Unfort

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. > > Y

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 u

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

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

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

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 C

Re: byte count unicode string

2006-09-22 Thread Paul Rubin
willie <[EMAIL PROTECTED]> writes: > >>> ustr = buf.decode('UTF-8') > >>> type(ustr) > > 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 ? --

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 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 lot

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.

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 "poku

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 e

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 >>implementa

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

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 ? >

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 c

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*. I

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 > (http://www.kuro5hin.org/

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 pointers/hints?

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

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 -- h

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:

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 versio

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 th

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-

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. http://realvnc.com/docs/r

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 > 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 exa

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 -- http://mail.python.org/mailman/listinfo/python-l

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 co

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 th

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 --prefix=$MY_PRE

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.

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".

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 We

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 negati

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: hello goodbye and I want to alphabetize not only

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 dis

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 nota

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: > > > hello

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

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

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 a

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

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 reply

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' sys.path.append(os.pat

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

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 com

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] > 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, pre

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 fo

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 o

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 t

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 >> compat

Re: Isn't bool __invert__ behaviour "strange"?

2006-09-22 Thread Saizan
Thanks for pointing that out ( the "!" is a misstyped "|"), my classes of discrete math have warped my mind with a mix of various non-C-style operators notation, I never use bitwise operation and this is just a bad day for thinking about things.. However I figured out one thing, Python's logic nota

Why are the topic and keyword documentation not includded in the chm?

2006-09-22 Thread Brendan
1)Why are the topic and keyword documentation not included in the Windows installation chm? I have to have both the html(with the env var PYTHONDOCS set) and the chm installed? What is the point of that? 2)Is there no simple way to open the chm docs in a browser from within python? 3)How do I op

Re: noob question

2006-09-22 Thread Jay
http://code.google.com/hosting/ 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) -- http://mail.python.org/mailman/listinfo/python-list

py2exe compression not working with Python 2.5

2006-09-22 Thread nikie
When I try to compress the output of py2exe like this: from distutils.core import setup import py2exe setup(console=['hello.py'], options={"py2exe": {"compressed": 1}}) I get strange error messages: Adding zlib.pyd to C:\tests\CanControllerTest\New Folder (2)\dist\library.zip Traceback (m

Replacing line in a text file

2006-09-22 Thread CSUIDL PROGRAMMEr
Folks I am trying to read a file This file has a line containing string 'disable = yes' I want to change this line to 'disable = no' The concern here is that , i plan to take into account the white spaces also. I tried copying all file int list and then tried to manipulate that list But the se

Re: Replacing line in a text file

2006-09-22 Thread Neil Cerutti
On 2006-09-22, CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> wrote: > Folks > I am trying to read a file > This file has a line containing string 'disable = yes' > > I want to change this line to 'disable = no' > > The concern here is that , i plan to take into account the white spaces > also. > > I tried

Re: Building things with setup.py

2006-09-22 Thread Robert Kern
James Stroud wrote: > Robert Kern wrote: >> James Stroud wrote: >>> The build process, by the way, required my copying libpython2.5.a to >>> $HOME/Programs/lib. >> Hmm. That doesn't quite sound right, but it's been a while since I >> compiled the interpreter from source. > > Sorry. To clarify,

Re: Replacing line in a text file

2006-09-22 Thread Tim Chase
> I am trying to read a file > This file has a line containing string 'disable = yes' > > I want to change this line to 'disable = no' Sounds like sed -i 's/disable *= *yes/disable = no/' file.txt would do what you want. It doesn't catch word boundaries, so if you have something like

Re: +1 QOTW

2006-09-22 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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/o

Re: py2exe compression not working with Python 2.5

2006-09-22 Thread Thomas Heller
nikie schrieb: > When I try to compress the output of py2exe like this: > > from distutils.core import setup > import py2exe > > setup(console=['hello.py'], options={"py2exe": {"compressed": 1}}) > > I get strange error messages: > > Adding zlib.pyd to C:\tests\CanControllerTest\New Folde

  1   2   >