Re: first, second, etc line of text file

2007-07-26 Thread Neil Cerutti
On 2007-07-25, George Sakkis <[EMAIL PROTECTED]> wrote: > For random access, the easiest way is to slurp all the file in > a list using file.readlines(). A lazy evaluation scheme might be useful for random access that only slurps as much as you need. class LazySlurper(object): r""" Lazily rea

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Scholl
Stefan Behnel <[EMAIL PROTECTED]> wrote: > Stefan Scholl wrote: >> Well, http://docs.python.org/lib/module-xml.sax.html is missing >> the fact, that I can't use Unicode with parseString(). >> >> This parseString() uses cStringIO. > > Well, Python unicode is not a valid *byte* encoding for XML. >

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-26 Thread John Machin
On Jul 26, 9:24 pm, [EMAIL PROTECTED] wrote: > OK, I solved the problem but I still don't get what went wrong. > Solution - use tree builder in order to create the new xml file > (previously I was "manually" creating it). > > I'm still curious so I'm adding a link to a short and very simple > scri

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Steve Holden
walterbyrd wrote: > On Jul 22, 12:17 am, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >> Either you are a casual user with 101 web >> development skills trying to set up your personal home page > > But this, sort of, brings me back to my original point. Nobody starts > out being advanced. T

Re: Tix.Tk() on Mac Intel

2007-07-26 Thread Daniel Nogradi
On 7/26/07, Alan <[EMAIL PROTECTED]> wrote: > Hi List! > > I have I Macbook Pro Intel running OSX 10.4.10. > > I downloaded Python 2.5 and tried > TclTkAquaBI-8.4.10.0.dmg, but I got: > > Traceback (most recent call last): > File "", line 1, in > File > "/Library/Frameworks/Python.framework/Vers

Re: Singleton in Python Cookbook

2007-07-26 Thread Alex Popescu
Steve Holden <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Alex Popescu wrote: >> Alex Popescu <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >>> "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in >>> news:[EMAIL PROTECTED]: >>> > > [snip...] > > If, that is, "work" means "R

Re: Tix.Tk() on Mac Intel

2007-07-26 Thread Kevin Walzer
Alan wrote: > Hi List! > > I have I Macbook Pro Intel running OSX 10.4.10. > > I downloaded Python 2.5 and tried > TclTkAquaBI-8.4.10.0.dmg, but I got: > > Traceback (most recent call last): > File "", line 1, in > File > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/

Re: os.path.walk usage on WinXP

2007-07-26 Thread Alex Popescu
Alex Popescu <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hi all! > > I am trying to use the os.path.walk function, but I am getting a weird > error: > > def _walk(dir_name): > def selector(arg, dirname, fnames): > print "selector" > > os.path.walk(dir_name, selector, None) >

[no subject]

2007-07-26 Thread Post Office
Virus Warning Message (from InterScanVirusWall mbox.infotel.bg) Found virus WORM_MYDOOM.GEN in file MESSAGE.BAT (in message.zip) The uncleanable file is deleted. If you have questions, contact administrator. - The original message was r

Re: class C: vs class C(object):

2007-07-26 Thread Bruno Desthuilliers
Aahz a écrit : (snip) > Enh. *All* of the standard Python documentation currently starts with > teaching classic classes, (snip) > There is almost no basic documentation > that starts with new-style classes; (snip) Just for the record: http://docs.python.org/ref/node33.html http://www.python.org

Re: code indentation

2007-07-26 Thread Steve Holden
Thorsten Kampe wrote: > * (Wed, 25 Jul 2007 11:22:03 -0700) >> On 25 srp, 17:31, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: >>> [EMAIL PROTECTED] wrote: > And while we're on the topic of communication: The original poster > would do well to learn that increasing the number of consecu

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Scholl
Stefan Behnel <[EMAIL PROTECTED]> wrote: > Stefan Scholl wrote: >> After an hour searching for a potential bug in XML parsing >> (PyXML), after updating from 2.4 to 2.5, I found this one: >> >> $ python2.5 >> Python 2.5 (release25-maint, Dec 9 2006, 14:35:53) >> [GCC 4.1.2 20061115 (prerelease) (

Re: datetime.time() class - How to pass it a time string?

2007-07-26 Thread Jay Loden
Ben Finney wrote: > Neil Cerutti <[EMAIL PROTECTED]> writes: > >> On 2007-07-24, Robert Dailey <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I have a string in the following format: >>> >>> "00:00:25.886411" >>> >>> I would like to pass this string into the datetime.time() class >>> and have it parse

instantiate a 'classobj'

2007-07-26 Thread westymatt
I have a class where a parameter to its constructor is a type(param) = 'classobj'. How would I go about instantiating that given it has no constructor. -- http://mail.python.org/mailman/listinfo/python-list

Re: zip() function troubles

2007-07-26 Thread Istvan Albert
On Jul 26, 7:44 pm, Paul Rubin wrote: > Istvan Albert <[EMAIL PROTECTED]> writes: > > exceeded 10 million the zip function slowed to a crawl. Note that > > there was memory available to store over 100 million items. > > How many bytes is that? Maybe the items (heap-alloc

reading data form an ISA port

2007-07-26 Thread Gabriel Dragffy
Dear list members I must admit I am a new user of Python, but it is a language that I enjoy using. For one of my university projects I need to write a program that can read several bytes from an ISA port. It has been suggested to me that I look at using C or Pyinline. If I can I would pre

generating objects of a type from a name.

2007-07-26 Thread chris . lyon
I'm trying to generate visual python objects from django objects and therefore have objects called 'Ring' and 'Cylinder' as django objects and I want to create objects of those names in visual. I can cludge it in varius ways by using dir and lots of if lookups but is there a way of doing this tha

Re: removing items from a dictionary ?

2007-07-26 Thread Ben Finney
Stef Mientki <[EMAIL PROTECTED]> writes: > I want to remove some items from a dictionary, > so I would expect this should work: > > Nets = {} > ... fill the dictionary Nets > > for net in Nets: > if net.upper() in Eagle_Power_Nets : > del Nets [ net ] Don't change the thing you'

Re: SQLObject 0.9.1

2007-07-26 Thread Sherm Pendley
Steve Holden <[EMAIL PROTECTED]> writes: > Sherm Pendley wrote: >> Gerardo Herzig <[EMAIL PROTECTED]> writes: >> >>> So..at 11:23 we got version 0.7.8...at 11:30 was version 0.8.5...now >>> there is a 0.9.1 version?? Have a coffe dude >> >> Sounds more to me like he needs to lay off the coffee, o

Re: Learning Jython?

2007-07-26 Thread Paul Rubin
Matt Bitten <[EMAIL PROTECTED]> writes: > It looks like Jython is for me. That said, I have two questions: > (1) Am I thinking straight here? Or is there some other solution that > a knows-Python-but-not-Java programmer might use? You are thinking of embedding Jython in a web applet? Probably not

Re: code indentation

2007-07-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > On 26 srp, 13:43, Steve Holden <[EMAIL PROTECTED]> wrote: >> Thorsten Kampe wrote: >>> * (Wed, 25 Jul 2007 11:22:03 -0700) On 25 srp, 17:31, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >>> And while we're on the topic of com

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread brad
James Stroud wrote: > Midway through a semester in college, after a few days (or was it a few > weeks?) of...well...lets just say I was studying real hard...I got lost > on my way to o-chem and wandered into the interior design department by > accident and found what I like to call "the motherlo

Re: CSV Issue

2007-07-26 Thread John Machin
On Jul 27, 7:19 am, Rohan <[EMAIL PROTECTED]> wrote: > f = open("/home/t/tp/va/e7.csv", "ab") a means Append -- you are appending the data that you expect to the EXISTING contents of the file. -- http://mail.python.org/mailman/listinfo/python-list

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread David Formosa (aka ? the Platypus)
["Followup-To:" header set to comp.lang.perl.misc.] On Thu, 26 Jul 2007 09:38:34 -0700, Paul Boddie <[EMAIL PROTECTED]> wrote: [...] > you'd show off your community a bit > better by entertaining even the most naive questions - people have to > start somewhere, you know. However asking a good qu

Re: pyparser and recursion problem

2007-07-26 Thread Neil Cerutti
On 2007-07-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Using pyparser, I'm trying to parse a string like this: > >:Start: first SECOND THIRD :SECOND: second1 | second2 :THIRD: third1 | > FOURTH :FOURTH: fourth1 | fourth2 > > I want the parser to do the following: > 1) Get the text for the :

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread brad
[EMAIL PROTECTED] wrote: > Python is a better language, with php support, anyway, but I am fed up > with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin > Perl experience for everyone. Instead of being helpful, snide remarks, > back-biting, scare tactings, and so on proliferate an

Re: From D

2007-07-26 Thread Kay Schluehr
On Jul 25, 7:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 24, 6:08 pm, Steven D'Aprano > > > > <[EMAIL PROTECTED]> wrote: > > On Tue, 24 Jul 2007 20:09:00 +0200, Bjoern Schliessmann wrote: > > > Stargaming wrote: > > >> On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: > >

Re: instantiate a 'classobj'

2007-07-26 Thread [EMAIL PROTECTED]
On Jul 26, 7:03 pm, westymatt <[EMAIL PROTECTED]> wrote: > I have a class where a parameter to its constructor is a type(param) = > 'classobj'. How would I go about instantiating that given it has no > constructor. A old style class may not have a __new__ attribute, but it's still callable, rig

Re: question about math module notation

2007-07-26 Thread brad
Paul Rubin wrote: > print 2**64 Ah yes, that works too... thanks. I've settled on doing it this way: print int(math.pow(2,64)) I like the added parenthesis :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Steve Holden
Paul Rubin wrote: > Jeffrey Froman <[EMAIL PROTECTED]> writes: >> Consider a PHP-based CMS that allows users to upload files. Because the >> application runs as the webserver user, uploaded files, and the directory >> where they reside, must be accessible and writable by that user. It is the >> sam

Re: Generating PDF reports

2007-07-26 Thread vasudevram
On 2007-07-26, marcpp <[EMAIL PROTECTED]> wrote: >Hi i'm introducing to do reports from python, any recomendation? Yes, ReportLab is quite a good PDF library for Python. I used it as the main underlying component in my xtopdf toolkit - see: http://www.dancingbison.com/products.html For most gen

Re: compiling sip on vista

2007-07-26 Thread Phil Thompson
On Thursday 26 July 2007 8:42 am, boriq wrote: > Hi, > > I'm trying to compile sip 4.6 on windows vista. > I have Python 2.5 installed in c:\Python25. > I have Qt 4.3.0 installed in c:\Qt\4.3.0 together with MinGW in c: > \MinGW. > I have environment variable PATH set to c:\Qt\4.3.0\bin;c:\MinGW\bi

Why is "for line in f" faster than readline()

2007-07-26 Thread Alexandre Ferrieux
Hi, In a recent thread I discovered why the "for line in f" idiom was not suitable for live sources (pipes, sockets, tty). The reason is that it uses buffering on input, blocking on a full buffer read before anything. When I asked why it did it this way, the answer came up that it made it faster.

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread Sherm Pendley
Steve Holden <[EMAIL PROTECTED]> writes: > On c.l.py there are standards of behavior, and we encourage people to > observe them (while attempting to engage politely with those who > don't). We also do that on c.l.perl.misc. The problems tend to arise when people get defensive and argumentative i

Problem Embedding Python in small Win32 App

2007-07-26 Thread Brad Johnson
I am just entering the world of Python embedding and I am running into a bug I am having a hard time fixing. Please be gentle. I am creating a small test application in Windows to test the embedding of the interpreter in order to execute arbitrary Python statements and print their results, all

Re: instantiate a 'classobj'

2007-07-26 Thread Steve Holden
westymatt wrote: > I have a class where a parameter to its constructor is a type(param) = > 'classobj'. How would I go about instantiating that given it has no > constructor. > Just call the parameter: if it's of type classobj then it's callable, and calling it will create an instance of the cla

Re: Scope PyQt question

2007-07-26 Thread dittonamed
On Jul 26, 10:15 pm, Stargaming <[EMAIL PROTECTED]> wrote: > On Thu, 26 Jul 2007 06:41:44 -0700, dittonamed wrote: > > Code pasted below -> > > > Can anyone out there suggest a way to access the object "p" thats > > started in playAudio() from inside the stopAudio()? I need the object > > refer

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Jeffrey Froman
walterbyrd wrote: > The point is: PHP framework makers are very considerate of the > realities of shared hosting. I think the opposite is true: PHP applications typically ignore the realities of shared hosting in order to be considerate to non-developers (that is to say, "users"). In particular,

SQLObject 0.7.8

2007-07-26 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.7.8 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started wit

SQLObject 0.8.5

2007-07-26 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.8.5 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started wi

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-26 Thread oren . tsur
On Jul 26, 3:13 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 26, 9:24 pm, [EMAIL PROTECTED] wrote: > > > OK, I solved the problem but I still don't get what went wrong. > > Solution - use tree builder in order to create the new xml file > > (previously I was "manually" creating it). > > > I

Re: Comparing Dictionaries

2007-07-26 Thread Ben Finney
Kenneth Love <[EMAIL PROTECTED]> writes: > In other words, I consider these two dictionaries to be equivalent: > > { 'dog' : 'bone', 'cat' : 'fever', 'mouse' : 'mickey' } > { 'mouse' : 'mickey', 'dog' : 'bone', 'cat' : 'fever' } > > while these two are not: > > { 'dog' : 'bone', 'ca

Re: Generating PDF reports

2007-07-26 Thread Carsten Haese
On Thu, 2007-07-26 at 16:02 +0200, marcpp wrote: > Hi i'm introducing to do reports from python, any recomendation? www.reportlab.org -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Bruno Desthuilliers
walterbyrd a écrit : > On Jul 22, 12:17 am, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >> Either you are a casual user with 101 web >> development skills trying to set up your personal home page > > But this, sort of, brings me back to my original point. Nobody starts > out being advanced

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Behnel
Stefan Scholl wrote: > Well, http://docs.python.org/lib/module-xml.sax.html is missing > the fact, that I can't use Unicode with parseString(). > > This parseString() uses cStringIO. Well, Python unicode is not a valid *byte* encoding for XML. lxml.etree can parse unicode, if you really want, bu

Re: os.path.walk usage on WinXP

2007-07-26 Thread Alex Popescu
Alex Popescu <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hi all! > > I am trying to use the os.path.walk function, but I am getting a weird > error: > > def _walk(dir_name): > def selector(arg, dirname, fnames): > print "selector" > > os.path.walk(dir_name, selector, None) >

Re: Singleton in Python Cookbook

2007-07-26 Thread Bruno Desthuilliers
Alex Popescu a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > >> Alex Popescu a écrit : > >> [snip...] >> >> >> I don't have the book, so if you don't post the code, I just give up >> trying to guess what the problem can be. > > I've sent the original co

os.path.walk usage on WinXP

2007-07-26 Thread Alex Popescu
Hi all! I am trying to use the os.path.walk function, but I am getting a weird error: def _walk(dir_name): def selector(arg, dirname, fnames): print "selector" os.path.walk(dir_name, selector, None) File "C:\zengarden\python\python25\lib\ntpath.py", line 325, in walk names = os.list

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-26 Thread oren . tsur
OK, I solved the problem but I still don't get what went wrong. Solution - use tree builder in order to create the new xml file (previously I was "manually" creating it). I'm still curious so I'm adding a link to a short and very simple script that gets an xml (containing non ascii chars) from th

Re: How to create a single executable of a Python program

2007-07-26 Thread Gabriel Genellina
En Thu, 26 Jul 2007 03:37:51 -0300, NicolasG <[EMAIL PROTECTED]> escribió: > I "want" to create a single file for two of my very simple/small > programs. For very simple/small programs I don't need to distribute > documentation, shortcuts etc.. I just want a single file to run ! See http://www.py

Re: adding a docstring to an instancemethod

2007-07-26 Thread jelle
> Set the __doc__ on the *function* from which you build the instance method. Thanks for you reply Gabriel, Though setting the docstring to the functions wouldn't be an option for me. The thing is that I have a wrappedCppModule.Class.Method I'd like to give a docstring, so there's no prior funct

Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Scholl
After an hour searching for a potential bug in XML parsing (PyXML), after updating from 2.4 to 2.5, I found this one: $ python2.5 Python 2.5 (release25-maint, Dec 9 2006, 14:35:53) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)] on linux2 Type "help", "copyright", "credits" or "license" for

compiling sip on vista

2007-07-26 Thread boriq
Hi, I'm trying to compile sip 4.6 on windows vista. I have Python 2.5 installed in c:\Python25. I have Qt 4.3.0 installed in c:\Qt\4.3.0 together with MinGW in c: \MinGW. I have environment variable PATH set to c:\Qt\4.3.0\bin;c:\MinGW\bin And here is what I did: C:\sip-4.6>configure.py -p win32-g

Re: question about math module notation

2007-07-26 Thread Paul Rubin
Dan Bishop <[EMAIL PROTECTED]> writes: > > I was surprised to find that gives an exact (integer, not > > floating-point) answer. Still, I think it's better to say 2**64 > > which also works for (e.g.) 2**1 where math.pow(2,1) > > raises an exception. > > It *is* binary floating point. Po

Re: question about math module notation

2007-07-26 Thread Dan Bishop
On Jul 26, 3:59 pm, Paul Rubin wrote: > brad <[EMAIL PROTECTED]> writes: > > Ah yes, that works too... thanks. I've settled on doing it this way: > > print int(math.pow(2,64)) > > I like the added parenthesis :) > > I was surprised to find that gives an exact (integer, no

Re: From D

2007-07-26 Thread Tim Williams
On 26/07/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> The str.split method has no bearing on this discussion, > It most certainly does. To make '123 456' into an integer, > you split it and then join it. > >>> z = '123 456' > >>> y = z.split() > >>> x = ''.join(y) > >>> w = int(x) > >>> w

Re: CSV Issue

2007-07-26 Thread Rohan
On Jul 26, 2:32 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 27, 7:19 am, Rohan <[EMAIL PROTECTED]> wrote: > > > f = open("/home/t/tp/va/e7.csv", "ab") > > a means Append -- you are appending the data that you expect to the > EXISTING contents of the file. Hello John, Yea silly mistake, wri

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread James Stroud
Steve Holden wrote: > Sadly there are too few female members of > either c.l.py or c.l.p.m for it to make much difference. Midway through a semester in college, after a few days (or was it a few weeks?) of...well...lets just say I was studying real hard...I got lost on my way to o-chem and wand

Cincinnati PUG

2007-07-26 Thread Arlinghaus, Andrea
Hello! I am a recruiter in the area and I am currently looking to fill a Python opportunity. I was wondering if you or anyone you might know would be interested in a job opportunity OR if I could possibly give you the job description to post. I would be happy to give you more information and an

curses/urwid simple menu

2007-07-26 Thread crony
Hello. Could you help me...I need to create application with urwid or curses support. Have you got a pretty simple example with it? -- Pozdrawiam Leszek Miś Nothing is secure, paranoia is your friend. -- http://mail.python.org/mailman/listinfo/python-list

Re: is_iterable function.

2007-07-26 Thread Neil Cerutti
On 2007-07-26, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 26 Jul 2007 15:02:39 +, Neil Cerutti wrote: > >> Based on the discussions in this thread (thanks all for your >> thoughts), I'm settling for: >> >> def is_iterable(obj): >> try: >> iter(obj).next() >> return

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Scholl
Stefan Behnel <[EMAIL PROTECTED]> wrote: > Stefan Scholl wrote: >> Stefan Behnel <[EMAIL PROTECTED]> wrote: >>> Stefan Scholl wrote: Stefan Behnel <[EMAIL PROTECTED]> wrote: > Stefan Scholl wrote: >> Well, http://docs.python.org/lib/module-xml.sax.html is missing >> the fact, that

Re: Scope PyQt question

2007-07-26 Thread David Boddie
On Thu Jul 26 18:00:44 CEST 2007, dittonamed wrote: > On Jul 26, 10:15 pm, Stargaming wrote: > > Answering from a non-Qt point of view (ie. I don't know if there were > > cleaner ways using Qt stuff), you have to bind p somewhere not local to > > the function. Any attribute of `self` (that's hop

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-26 Thread oren . tsur
On Jul 26, 4:34 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Jul 26, 3:13 pm, John Machin <[EMAIL PROTECTED]> wrote: > >> On Jul 26, 9:24 pm, [EMAIL PROTECTED] wrote: > > >>> OK, I solved the problem but I still don't get what went wrong. > >>> Solution - use tree

ANN: eGenix EuroPython 2007 Presentations & Videos

2007-07-26 Thread eGenix Team: M.-A. Lemburg
eGenix EuroPython 2007 Presentations & Videos eGenix is pleased to announce the immediate availability of PDF and Flash video versions of t

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Behnel
Stefan Scholl wrote: > Stefan Behnel <[EMAIL PROTECTED]> wrote: >> Stefan Scholl wrote: >>> Well, http://docs.python.org/lib/module-xml.sax.html is missing >>> the fact, that I can't use Unicode with parseString(). >>> >>> This parseString() uses cStringIO. >> Well, Python unicode is not a valid *b

Re: Singleton in Python Cookbook

2007-07-26 Thread Alex Popescu
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Alex Popescu a écrit : > > [snip...] > > > I don't have the book, so if you don't post the code, I just give up > trying to guess what the problem can be. I've sent the original code and 2 different variants a long tim

Re: wxGlade: Who knows how to drive this application?

2007-07-26 Thread Alberto Griggio
Hello, > I've been trying to use wxGlade recently and I am finding it something > of a challenge. Is there any user who finds the user interface > satisfactory and the operation of the program predictable? > > If so I would love to hear from you. Do you have some specific example of what you mea

Re: pyparser and recursion problem

2007-07-26 Thread pyscottishguy
Hey, Thanks Neil and Paul! After reading Neil's advice I started playing around with the setParseAction method, and then I found Paul's script 'macroExpander.py' (http://pyparsing.wikispaces.com/space/showimage/ macroExpander.py). With only a few modifications to macroExpander.py (and reversing

C API -- Two questions

2007-07-26 Thread beginner
Hi Everyone, I am writing a C extension and encountered two problems. 1) How can I include a description of the arguments? I can include a description string. No problem. But whenever I say help(my_func) it shows the arguments are "... ". However, if a function is defined in python, I will defini

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread John K Masters
On 16:33 Thu 26 Jul , brad wrote: > [EMAIL PROTECTED] wrote: > > Python is a better language, with php support, anyway, but I am fed up > > with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin > > Perl experience for everyone. Instead of being helpful, snide remarks, > > back-

Re: How to tell when a socket is closed on the other end?

2007-07-26 Thread Roy Smith
Jay Loden <[EMAIL PROTECTED]> wrote: > The goal of this > portion of the test suite we are writing for the project is to determine if a > remote server is behaving properly by closing a socket from the server side > based on a client-side command. > > Really what's needed is a way to make sure

Re: is_iterable function.

2007-07-26 Thread George Sakkis
On Jul 26, 2:56 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-07-26, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > > On Thu, 26 Jul 2007 15:02:39 +, Neil Cerutti wrote: > > >> Based on the discussions in this thread (thanks all for your > >> thoughts), I'm settling for: >

Re: From D

2007-07-26 Thread [EMAIL PROTECTED]
On Jul 26, 1:24 am, Ben Finney <[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > On Jul 25, 9:04?pm, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > > Why does it make no sense? Have you never had to scrape a web page > > or read a CSV file? > > Again, unrelated to t

python static with Numeric

2007-07-26 Thread Alan
Hi List! Does anyone here knows how to compile python with Numeric in a static way? Many thanks in advance. Cheers, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: automatic type conversion for comparison operators

2007-07-26 Thread Dan Bishop
On Jul 26, 8:04 pm, Russ <[EMAIL PROTECTED]> wrote: > Dan Bishop wrote: > > BTW, are you a former Pascal programmer? > > No. Why do you ask? [The code snippet I wrote was made up to get a > point across. I > did not actually use that function name in my code.] I just have a hypothesis that former

Weekly Python Patch/Bug Summary

2007-07-26 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 399 open ( +5) / 3836 closed ( +9) / 4235 total (+14) Bugs: 1056 open (+10) / 6776 closed ( +3) / 7832 total (+13) RFE : 263 open ( +1) / 294 closed ( +1) / 557 total ( +2) New / Reopened Patches __ utilize 2

Re: How to tell when a socket is closed on the other end?

2007-07-26 Thread Josiah Carlson
Jay Loden wrote: > Roy Smith wrote: >> In article <[EMAIL PROTECTED]>, >> billiejoex <[EMAIL PROTECTED]> wrote: >> >>> Hi there. >>> I'm setting up test suite for a project of mine. >>> >From test suite, acting as a client, I'd like to know, in certain >>> situations, if the socket is closed on th

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Scholl
Chris Mellon <[EMAIL PROTECTED]> wrote: > XML is not a string. It's a specific type of bytestream. If you want > to work with XML, then generate well-formed XML in the correct > encoding. There's no reason you should have an XML document (as > opposed to values extracted from that document) in unic

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread paul
Carsten Haese schrieb: >> Also, PHP, and PHP frameworks, are supported everywhere. If you going >> to use a PHP MVC framework, like codeignitor, you would have a hard >> time finding a hoster that didn't support it - all you need is php4 >> and mysql. Dollar-hosting, for $10 a year, should work jus

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Scholl
Stefan Behnel <[EMAIL PROTECTED]> wrote: > Stefan Scholl wrote: >> Stefan Behnel <[EMAIL PROTECTED]> wrote: >>> Stefan Scholl wrote: Well, http://docs.python.org/lib/module-xml.sax.html is missing the fact, that I can't use Unicode with parseString(). This parseString() uses cSt

I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread matt westerburg
Maybe we should welcome zentara instead of try to recreate the perl experience. Your not a troll either. That is very inappropriate and rather rude. Welcome to Python enjoy! -- http://mail.python.org/mailman/listinfo/python-list

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Behnel
Stefan Scholl wrote: > Stefan Behnel <[EMAIL PROTECTED]> wrote: >> Stefan Scholl wrote: >>> Stefan Behnel <[EMAIL PROTECTED]> wrote: Stefan Scholl wrote: > Stefan Behnel <[EMAIL PROTECTED]> wrote: >> Stefan Scholl wrote: >>> Well, http://docs.python.org/lib/module-xml.sax.html is m

Re: question about math module notation

2007-07-26 Thread Paul Rubin
brad <[EMAIL PROTECTED]> writes: > 18,446,744,073,709,551,616 > > I'm lazy... I don't want to convert it manually :) print 2**64 -- http://mail.python.org/mailman/listinfo/python-list

Re: zip() function troubles

2007-07-26 Thread Peter Otten
Istvan Albert wrote: > I've been debugging the reason for a major slowdown in a piece of > code ... and it turns out that it was the zip function. In the past > the lists that were zipped were reasonably short, but once the size > exceeded 10 million the zip function slowed to a crawl. Note that >

Re: C API -- Two questions

2007-07-26 Thread Marc 'BlackJack' Rintsch
On Fri, 27 Jul 2007 00:34:22 +, beginner wrote: > 2) How can I make the arguments less picky without writing a lot of > type conversion code? My function really needs a tuple as its > argument. For example, f( (1,2,3) ) would work. However, in order to > make it easy to use, I am thinking that

Re: zip() function troubles

2007-07-26 Thread Terry Reedy
"Istvan Albert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || if you try it yourself you'll see that it is very easy to generate 10 | million tuples, No it is not on most machines. | on my system it takes 3 (!!!) seconds to do the following: | | size = 10**7 | data = [] | for

Re: zip() function troubles

2007-07-26 Thread Paul Rubin
Peter Otten <[EMAIL PROTECTED]> writes: > When you are allocating a lot of objects without releasing them the garbage > collector kicks in to look for cycles. Try switching it off: I think that is the answer. The zip took almost 2 minutes without turning gc off, but takes 1.25 seconds with gc off

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Behnel
Stefan Scholl wrote: > Stefan Behnel <[EMAIL PROTECTED]> wrote: >> The XML is *not* well-formed if you pass Python unicode instead of a byte >> encoded string. Read the XML spec. > > Pointers, please. There you have it: http://www.w3.org/TR/xml/#charencoding """ In the absence of information pr

<    1   2