Re: Diff of Text

2010-06-04 Thread GZ
On Jun 4, 8:37 pm, Lie Ryan wrote: > On06/05/10 07:51, GZ wrote: > > > > > > > Hi Pat, > > > On Jun 4, 2:55 pm, Patrick Maupin wrote: > >> On Jun 3, 9:54 pm, GZ wrote: > > >>> Hi All, > > >>> I am looking for an algorithm that can compare to source code files > >>> line by line and find the mini

Re: An empty object with dynamic attributes (expando)

2010-06-04 Thread Terry Reedy
On 6/4/2010 10:25 PM, Alf P. Steinbach wrote: As far as I can think of now, one cannot add attributes to *any* builtin-class instance, but can add attributes to any user class which does not have them disabled. >>> [].a = 3 Traceback (most recent call last): File "", line 1, in [].a = 3 Attrib

Re: Python Forum

2010-06-04 Thread John Bokma
Steven D'Aprano writes: > On Fri, 04 Jun 2010 08:56:34 -0500, Jim Byrnes wrote: > >> I thought his point was they are big enough to have the resources to >> offer newsgroups but don't. If I want fast internet I must use Comcast >> and Comcast doesn't offer newsgroups either. Sadly is seems gett

Re: Python Forum

2010-06-04 Thread Steven D'Aprano
On Fri, 04 Jun 2010 15:55:08 -0500, John Bokma wrote: > "Alf P. Steinbach" writes: [...] >> It started, as I see it, back in the early 90's with Playboy attempting >> to sue anyone who used the Lena picture in photo processing tests etc. >> (it's the standard image for that). They failed in that

Re: Python Forum

2010-06-04 Thread John Bokma
Lie Ryan writes: > If you look at Stack Overflow, the highest voted questions are: > > - Hidden Features of C#? > - What is the single most influential book every programmer should read? > - What's your favorite "programmer" cartoon? > - What is your best programmer joke? > ... and so on > > many

Re: Python Forum

2010-06-04 Thread John Bokma
Grant Edwards writes: > On 2010-06-04, John Bokma wrote: >> Lie Ryan writes: >> >>> On 06/05/10 04:19, John Bokma wrote: Steven D'Aprano writes: > But the really sad thing is that you think that "bigger" automatically > equals "better". I don't think that was the

Re: Python Forum

2010-06-04 Thread Steven D'Aprano
On Fri, 04 Jun 2010 02:29:58 -0400, D'Arcy J.M. Cain wrote: > On 04 Jun 2010 05:41:17 GMT > Steven D'Aprano wrote: >> Sure, a lot of those 1,800 posts are spam, but the spammers wouldn't >> waste their time if they didn't think there were people still on >> Usenet. > > Kidding, right? Cost to s

Re: An empty object with dynamic attributes (expando)

2010-06-04 Thread Alf P. Steinbach
* Terry Reedy, on 05.06.2010 03:01: On 6/4/2010 8:01 PM, dmtr wrote: Why does it have to be a one-liner? Is the Enter key on your keyboard broken? Nah. I was simply looking for something natural and intuitive, like: m = object(); m.a = 1; Usually python is pretty good providing these natural a

Re: Python Forum

2010-06-04 Thread Steven D'Aprano
On Sat, 05 Jun 2010 05:22:21 +1000, Lie Ryan wrote: > Probably. A vote up/down feature tend to highlight popular problems, but > it also buries less popular problems that might have perfectly good > answers. I think Google Groups have 5-star-rating system? You might want > to check on that. I don

Re: Python Forum

2010-06-04 Thread Steven D'Aprano
On Fri, 04 Jun 2010 08:56:34 -0500, Jim Byrnes wrote: > I thought his point was they are big enough to have the resources to > offer newsgroups but don't. If I want fast internet I must use Comcast > and Comcast doesn't offer newsgroups either. Sadly is seems getting > access to newsgroups is ge

Re: bz2 module doesn't work properly with all bz2 files

2010-06-04 Thread Steven D'Aprano
On Fri, 04 Jun 2010 12:53:26 -0700, Magdoll wrote: > I'm not sure what's causing this, but depending on the compression > program used, the bz2 module sometimes exits earlier. [...] The current bz2 module only supports files written as a single stream, and not multiple stream files. This is why

Re: Diff of Text

2010-06-04 Thread Lie Ryan
On 06/05/10 07:51, GZ wrote: > Hi Pat, > > On Jun 4, 2:55 pm, Patrick Maupin wrote: >> On Jun 3, 9:54 pm, GZ wrote: >> >>> Hi All, >> >>> I am looking for an algorithm that can compare to source code files >>> line by line and find the minimum diff. I have looked at the difflib >>> included in p

Re: Python Forum

2010-06-04 Thread Lie Ryan
On 06/05/10 06:57, John Bokma wrote: > Lie Ryan writes: > >> On 06/04/10 11:56, John Bokma wrote: >>> Phlip writes: >>> On Jun 3, 3:20 pm, geremy condra wrote: >> You mean like how I never get answers, to my super-easy GED-level >> questions, here??! > > I agree. This

Re: Python Forum

2010-06-04 Thread Terry Reedy
On 6/4/2010 3:04 PM, Emile van Sebille wrote: On 6/4/2010 11:27 AM Terry Reedy said... On 6/4/2010 12:28 PM, Emile van Sebille wrote: Is there now a non-email method of posting to this list? Google <==> comp.lang.python <==> python-list <==> gmane.comp.python.general where <==> is a bi-dire

Re: An empty object with dynamic attributes (expando)

2010-06-04 Thread Terry Reedy
On 6/4/2010 8:01 PM, dmtr wrote: Why does it have to be a one-liner? Is the Enter key on your keyboard broken? Nah. I was simply looking for something natural and intuitive, like: m = object(); m.a = 1; Usually python is pretty good providing these natural and intuitive solutions. As far as I

Re: plac, the easiest command line arguments parser in the world

2010-06-04 Thread Kenny Meyer
On Jun 2, 12:37 am, Michele Simionato wrote: > I would like to announce to the world the first public release of > plac: > >  http://pypi.python.org/pypi/plac > > Plac is a wrapper over argparse and works in all versions of > Python starting from Python 2.3 up to Python 3.1. > > With blatant immod

Re: An empty object with dynamic attributes (expando)

2010-06-04 Thread dmtr
> Why does it have to be a one-liner? Is the Enter key on your keyboard > broken? Nah. I was simply looking for something natural and intuitive, like: m = object(); m.a = 1; Usually python is pretty good providing these natural and intuitive solutions. > You have a perfectly good solution: defin

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-04 Thread Dan Stromberg
On Thu, Jun 3, 2010 at 3:43 PM, Emin.shopper Martinian.shopper < emin.shop...@gmail.com> wrote: > Dear Experts, > > I am getting a MemoryError when creating a dict in a long running > process and suspect this is due to memory fragmentation. Any > suggestions would be welcome. Full details of the p

Re: Missing DLL in win98

2010-06-04 Thread Spyder42
On Fri, 04 Jun 2010 14:03:48 -0400, Terry Reedy wrote: >On 6/4/2010 9:08 AM, Spyder42 wrote: >> On Fri, 04 Jun 2010 14:50:28 +0200, Christian Heimes > >>> Python 2.6 is not supported on Windows 98 and earlier. You need at least >>> Windows 2000 with a recent service pack. >>> >>> Christian >> >>

Re: bz2 module doesn't work properly with all bz2 files

2010-06-04 Thread Magdoll
On Jun 4, 3:05 pm, Cameron Simpson wrote: > On 04Jun2010 12:53, Magdoll wrote: > | I'm not sure what's causing this, but depending on the compression > | program used, the bz2 module sometimes exits earlier. > | > | I used pbzip2 to compress my bz2 files and read through the file using > | the bz

Re: Plotting in batch with no display

2010-06-04 Thread exarkun
On 08:01 pm, h.schaat...@surrey.ac.uk wrote: Admittedly not the strongest reason, but yet an important one, for switching from Matlab to python/numpy/scipy/matplotlib, is that Matlab is very cumbersome to run in batch. Now I discover that some of the matplotlib.pyplot functions (incl. plot and c

Re: Python Forum

2010-06-04 Thread Grant Edwards
On 2010-06-04, John Bokma wrote: > Lie Ryan writes: > >> On 06/05/10 04:19, John Bokma wrote: >>> Steven D'Aprano writes: >>> But the really sad thing is that you think that "bigger" automatically equals "better". >>> >>> I don't think that was the point. >>> >>> Anyway, not everbo

Re: Python Forum

2010-06-04 Thread John Bokma
geremy condra writes: > On Fri, Jun 4, 2010 at 1:55 PM, John Bokma wrote: >> I know of the use of Lena. And to be honest, I agree with Playboy that >> they have the copyright. Some of the articles published on image >> processing end up behind a paywall or in a book. And I don't think the >> aut

Re: bz2 module doesn't work properly with all bz2 files

2010-06-04 Thread Cameron Simpson
On 04Jun2010 12:53, Magdoll wrote: | I'm not sure what's causing this, but depending on the compression | program used, the bz2 module sometimes exits earlier. | | I used pbzip2 to compress my bz2 files and read through the file using | the bz2 module. The file descriptor always exits much earlie

Re: Diff of Text

2010-06-04 Thread GZ
Hi Pat, On Jun 4, 2:55 pm, Patrick Maupin wrote: > On Jun 3, 9:54 pm, GZ wrote: > > > Hi All, > > > I am looking for an algorithm that can compare to source code files > > line by line and find the minimum diff. I have looked at the difflib > > included in python. The problem is that it is desig

Re: Python Forum

2010-06-04 Thread geremy condra
On Fri, Jun 4, 2010 at 1:55 PM, John Bokma wrote: > I know of the use of Lena. And to be honest, I agree with Playboy that > they have the copyright. Some of the articles published on image > processing end up behind a paywall or in a book. And I don't think the > authors will be very happy if I c

Re: if, continuation and indentation

2010-06-04 Thread Aahz
In article , Tim Chase wrote: > >While it's not PEP material, I tend to use the coding standards I >learned working for Computer Sciences Corporation (10 yrs ago, so >things may have changed) that mandated 2 levels of indentation >for continued lines, turning the above into > > if (width ==

Re: Plotting in batch with no display

2010-06-04 Thread Emile van Sebille
On 6/4/2010 1:01 PM Hans Georg Schaathun said... Admittedly not the strongest reason, but yet an important one, for switching from Matlab to python/numpy/scipy/matplotlib, is that Matlab is very cumbersome to run in batch. Now I discover that some of the matplotlib.pyplot functions (incl. plot a

Re: Python Forum

2010-06-04 Thread John Bokma
Lie Ryan writes: > On 06/05/10 04:19, John Bokma wrote: >> Steven D'Aprano writes: >> >>> But the really sad thing is that you think that "bigger" automatically >>> equals "better". >> >> I don't think that was the point. >> >> Anyway, not everbody can pick a provider, there are plenty of pl

Re: Python Forum

2010-06-04 Thread John Bokma
Lie Ryan writes: > On 06/04/10 11:56, John Bokma wrote: >> Phlip writes: >> >>> On Jun 3, 3:20 pm, geremy condra wrote: >>> > You mean like how I never get answers, to my super-easy GED-level > questions, here??! I agree. This proves conclusively that a web forum is the right

Re: Python Forum

2010-06-04 Thread John Bokma
"Alf P. Steinbach" writes: > * John Bokma, on 04.06.2010 20:19: >> Steven D'Aprano writes: >> >>> But the really sad thing is that you think that "bigger" automatically >>> equals "better". >> >> I don't think that was the point. >> >> Anyway, not everbody can pick a provider, there are plenty o

Re: tallying occurrences in list

2010-06-04 Thread kj
Thank you all! ~K -- http://mail.python.org/mailman/listinfo/python-list

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-04 Thread Bryan
Philip Semanchuk wrote: > At PyCon 2010, Brandon Craig Rhodes presented about how dictionaries   > work under the > hood:http://python.mirocommunity.org/video/1591/pycon-2010-the-mighty-dict... > > I found that very informative. That's a fine presentation of hash tables in general and Python's ch

Plotting in batch with no display

2010-06-04 Thread Hans Georg Schaathun
Admittedly not the strongest reason, but yet an important one, for switching from Matlab to python/numpy/scipy/matplotlib, is that Matlab is very cumbersome to run in batch. Now I discover that some of the matplotlib.pyplot functions (incl. plot and contour) insist on opening an X11 window (just

Re: how to access data attributes of a class object

2010-06-04 Thread namrata
Thanks a lot Peter. It works. On Jun 4, 12:26 pm, Peter Otten <__pete...@web.de> wrote: > namrata wrote: > > I am creating an instance of a class. for example let the class be > > Temp and the attributes of the class be first_name and last_name. > > in order to access the attributes i will usually

Re: signed vs unsigned int

2010-06-04 Thread John Nagle
johnty wrote: i'm reading bytes from a serial port, and storing it into an array. Try reading into a type "bytearray". That's the proper data type for raw bytes. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: tallying occurrences in list

2010-06-04 Thread Lie Ryan
On 06/05/10 04:38, Magdoll wrote: > On Jun 4, 11:33 am, Peter Otten <__pete...@web.de> wrote: >> kj wrote: >> >>> Task: given a list, produce a tally of all the distinct items in >>> the list (for some suitable notion of "distinct"). >> >>> Example: if the list is ['a', 'b', 'c', 'a', 'b', 'c', 'a'

Re: Diff of Text

2010-06-04 Thread Patrick Maupin
On Jun 3, 9:54 pm, GZ wrote: > Hi All, > > I am looking for an algorithm that can compare to source code files > line by line and find the minimum diff. I have looked at the difflib > included in python. The problem is that it is designed to make the > diff results easier for humans to read, inste

bz2 module doesn't work properly with all bz2 files

2010-06-04 Thread Magdoll
I'm not sure what's causing this, but depending on the compression program used, the bz2 module sometimes exits earlier. I used pbzip2 to compress my bz2 files and read through the file using the bz2 module. The file descriptor always exits much earlier than where the actual EOF is. If I use bzip2

Re: signed vs unsigned int

2010-06-04 Thread Patrick Maupin
On Jun 2, 6:25 am, John Machin wrote: > On Jun 2, 4:43 pm, johnty wrote: > > > i'm reading bytes from a serial port, and storing it into an array. > > > each byte represents a signed 8-bit int. > > > currently, the code i'm looking at converts them to an unsigned int by > > doing ord(array[i]). h

Re: Python Forum

2010-06-04 Thread Lie Ryan
On 06/05/10 05:04, Emile van Sebille wrote: > On 6/4/2010 11:27 AM Terry Reedy said... >> On 6/4/2010 12:28 PM, Emile van Sebille wrote: >> >>> Is there now a non-email method of posting to this list? >> >> Google <==> comp.lang.python <==> python-list <==> >> gmane.comp.python.general >> >> where

Re: Python Forum

2010-06-04 Thread Lie Ryan
On 06/05/10 04:19, John Bokma wrote: > Steven D'Aprano writes: > >> But the really sad thing is that you think that "bigger" automatically >> equals "better". > > I don't think that was the point. > > Anyway, not everbody can pick a provider, there are plenty of places > that have only one or

Re: Street address parsing in Python, again.

2010-06-04 Thread John Nagle
John Nagle wrote: The parser at PyParsing: http://pyparsing.wikispaces.com/file/view/streetAddressParser.py ..Bad cases... 487 E. Middlefield Rd. -> streetnumber = 487, streetname = E. MIDDLEFIELD 487 East Middlefield Road -> streetnumber = 487, streetname = EAST MIDDLEFIELD 226 West

RE: [python] pass the name of args

2010-06-04 Thread jyoung79
Would vars() help? Check out this link: http://www.daniweb.com/forums/thread134555.html Jay -- > def myDef(x) > doSomething x > result = x. > return coolThings > - > > WhatYourName = ('python','is','cool') > > myDef(WhatYourName) > > so

Re: how to access data attributes of a class object

2010-06-04 Thread Peter Otten
namrata wrote: > I am creating an instance of a class. for example let the class be > Temp and the attributes of the class be first_name and last_name. > in order to access the attributes i will usually use the following > command: > a = Temp() > a.last_name = "***" > > now, i am using sqlalc

Re: Python Forum

2010-06-04 Thread Lie Ryan
On 06/04/10 11:56, John Bokma wrote: > Phlip writes: > >> On Jun 3, 3:20 pm, geremy condra wrote: >> You mean like how I never get answers, to my super-easy GED-level questions, here??! >>> >>> I agree. This proves conclusively that a web forum is the right >>> place for you. >> >> Ah,

how to access data attributes of a class object

2010-06-04 Thread namrata
Hi, i am new to python and sqlalchemy. so my doubt mite be very silly. I am creating an instance of a class. for example let the class be Temp and the attributes of the class be first_name and last_name. in order to access the attributes i will usually use the following command: a = Temp() a.last

Re: Python Forum

2010-06-04 Thread Alf P. Steinbach
* John Bokma, on 04.06.2010 20:19: Steven D'Aprano writes: But the really sad thing is that you think that "bigger" automatically equals "better". I don't think that was the point. Anyway, not everbody can pick a provider, there are plenty of places that have only one or maybe two. And if t

Re: Python Forum

2010-06-04 Thread Emile van Sebille
On 6/4/2010 11:27 AM Terry Reedy said... On 6/4/2010 12:28 PM, Emile van Sebille wrote: Is there now a non-email method of posting to this list? Google <==> comp.lang.python <==> python-list <==> gmane.comp.python.general where <==> is a bi-directional gateway. Yes -- I use gmane as well.

Re: tallying occurrences in list

2010-06-04 Thread MRAB
kj wrote: Task: given a list, produce a tally of all the distinct items in the list (for some suitable notion of "distinct"). Example: if the list is ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'a'], then the desired tally would look something like this: [('a', 4), ('b', 3), ('c', 3)] I

Re: Python Forum

2010-06-04 Thread Andreas Waldenburger
On Fri, 04 Jun 2010 20:36:02 +0200 "Alf P. Steinbach" wrote: > * Andreas Waldenburger, on 04.06.2010 20:21: > > On Fri, 04 Jun 2010 00:57:15 +1000 Ben Finney > > wrote: > > > >> Andreas Waldenburger writes: > >> > >>> But consolidation is the *only* way to go, really. The parallelism > >>> bet

Re: Python Forum

2010-06-04 Thread John Bokma
Emile van Sebille writes: > On 6/3/2010 10:41 PM Steven D'Aprano said... >> On Thu, 03 Jun 2010 06:15:20 -0400, Adam Tauno Williams wrote: >>> Most people use this list via e-mail, >> >> How do you know? Do you have evidence for this, or are you just making it >> up? >> > > Is there now a non-ema

Re: Python Forum

2010-06-04 Thread John Bokma
Steven D'Aprano writes: > Sure, a lot of those 1,800 posts are spam, but the spammers wouldn't > waste their time if they didn't think there were people still on > Usenet. Heh, since spamming goes automatically who cares how many people it reaches. I also see spam in which people forget to incl

Re: strange syntax error

2010-06-04 Thread Jerry Hill
On Fri, Jun 4, 2010 at 1:31 PM, _wolf wrote: >    File "", line 6 >      # >      ^ >  SyntaxError: invalid syntax I believe you're encountering this bug: http://bugs.python.org/issue1184112 It's been fixed for 2.7 and 3.2. Until then, you'll need to work around it. You can either append a new

Re: tallying occurrences in list

2010-06-04 Thread Magdoll
On Jun 4, 11:33 am, Peter Otten <__pete...@web.de> wrote: > kj wrote: > > > Task: given a list, produce a tally of all the distinct items in > > the list (for some suitable notion of "distinct"). > > > Example: if the list is ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', > > 'c', 'a'], then the desired

Re: Python Forum

2010-06-04 Thread John Bokma
Pierre Quentel writes: > They certainly *can* distinguish. But it's so easy to make it more > explicit with syntax highlighting, background color, border etc. that > most sites about programing languages use it, including the Python > home site itself, or the Python cookbook on Active State [..]

Re: Python Forum

2010-06-04 Thread Andreas Waldenburger
On Fri, 04 Jun 2010 09:28:23 -0700 Emile van Sebille wrote: > On 6/3/2010 10:41 PM Steven D'Aprano said... > > On Thu, 03 Jun 2010 06:15:20 -0400, Adam Tauno Williams wrote: > >> Most people use this list via e-mail, > > > > How do you know? Do you have evidence for this, or are you just > > maki

Re: tallying occurrences in list

2010-06-04 Thread Magdoll
On Jun 4, 11:28 am, Paul Rubin wrote: > kj writes: > > 1. is there a standard name for it? > > I don't know of one, or a stdlib for it, but it's pretty trivial. > > > def tally(c): > >     t = dict() > >     for x in c: > >         t[x] = t.get(x, 0) + 1 > >     return sorted(t.items(), key=lambd

Re: Python Forum

2010-06-04 Thread Alf P. Steinbach
* Andreas Waldenburger, on 04.06.2010 20:21: On Fri, 04 Jun 2010 00:57:15 +1000 Ben Finney wrote: Andreas Waldenburger writes: But consolidation is the *only* way to go, really. The parallelism between c.l.p. and python-list is great already. Now throw some sort of Forum in the mix This

Re: tallying occurrences in list

2010-06-04 Thread Peter Otten
kj wrote: > > > > > > Task: given a list, produce a tally of all the distinct items in > the list (for some suitable notion of "distinct"). > > Example: if the list is ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', > 'c', 'a'], then the desired tally would look something like this: > > [('a', 4),

Re: tallying occurrences in list

2010-06-04 Thread Paul Rubin
kj writes: > 1. is there a standard name for it? I don't know of one, or a stdlib for it, but it's pretty trivial. > def tally(c): > t = dict() > for x in c: > t[x] = t.get(x, 0) + 1 > return sorted(t.items(), key=lambda x: (-x[1], x[0])) I like to use defaultdict and tuple

Re: Python Forum

2010-06-04 Thread Terry Reedy
On 6/4/2010 12:28 PM, Emile van Sebille wrote: Is there now a non-email method of posting to this list? Google <==> comp.lang.python <==> python-list <==> gmane.comp.python.general where <==> is a bi-directional gateway. Gmane mirrors about 250 other Python mailing lists under gman.comp.pyt

Re: Python Forum

2010-06-04 Thread Andreas Waldenburger
On Fri, 04 Jun 2010 00:57:15 +1000 Ben Finney wrote: > Andreas Waldenburger writes: > > > But consolidation is the *only* way to go, really. The parallelism > > between c.l.p. and python-list is great already. Now throw some sort > > of Forum in the mix > > This already *is* a forum. Whatever

Re: Python Forum

2010-06-04 Thread John Bokma
Steven D'Aprano writes: > But the really sad thing is that you think that "bigger" automatically > equals "better". I don't think that was the point. Anyway, not everbody can pick a provider, there are plenty of places that have only one or maybe two. And if that's the choice and neither carri

tallying occurrences in list

2010-06-04 Thread kj
Task: given a list, produce a tally of all the distinct items in the list (for some suitable notion of "distinct"). Example: if the list is ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'a'], then the desired tally would look something like this: [('a', 4), ('b', 3), ('c', 3)] I find myself

Street address parsing in Python, again.

2010-06-04 Thread John Nagle
I'm still struggling with street address parsing in Python. (Previous discussion: http://www.velocityreviews.com/forums/t720759-usable-street-address-parser-in-python.html) I need something good enough to reliably extract street name and number. That gives me something I can match against

Re: Missing DLL in win98

2010-06-04 Thread Terry Reedy
On 6/4/2010 9:08 AM, Spyder42 wrote: On Fri, 04 Jun 2010 14:50:28 +0200, Christian Heimes Python 2.6 is not supported on Windows 98 and earlier. You need at least Windows 2000 with a recent service pack. Christian So your response is either, you don't know if there is a fix, or 'No way in h

Re: General questions - where & how

2010-06-04 Thread Terry Reedy
On 6/4/2010 1:35 PM, Philip Semanchuk wrote: On Jun 4, 2010, at 1:22 PM, Uriah Eisenstein wrote: Hi all, I'm relatively new to Python and have a few questions. Frankly, it took me a while to find on python.org what seems like a suitable place to post my questions. However, I'd like to check th

Re: [python] pass the name of args

2010-06-04 Thread Terry Reedy
On 6/4/2010 7:32 AM, macm wrote: A few types of objects have definition names (.__name__ attribute). All have 0 to many namespace names. If you want to pass an attribute name, pass it -- as a string. def myDef(x) doSomething x result = x. return coolThings def f

Re: weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-04 Thread kirby.ur...@gmail.com
On Jun 4, 9:47 am, Peter Otten <__pete...@web.de> wrote: > I can provoke the error in "naked" Python 3 by changing the > Example.__module__ attribute: > > Python 3.1.1+ (r311:74480, Nov  2 2009, 15:45:00) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more informati

Re: General questions - where & how

2010-06-04 Thread Philip Semanchuk
On Jun 4, 2010, at 1:22 PM, Uriah Eisenstein wrote: Hi all, I'm relatively new to Python and have a few questions. Frankly, it took me a while to find on python.org what seems like a suitable place to post my questions. However, I'd like to check the archives and see if they haven't been

strange syntax error

2010-06-04 Thread _wolf
this may not be an earth-shattering deficiency of python, but i still wonder about the rationale behind the following behavior: when i run :: source = """ print( 'helo' ) if __name__ == '__main__': print( 'yeah!' ) #""" print( compile( source, '', 'exec' ) ) i get :: File "",

Re: General questions - where & how

2010-06-04 Thread Alex Hall
I am not sure about a search feature for the archives, but I can tell you about a "tutor" list for those new and somewhat new to Python (like me). Of course, both that list and this one are excellent resources, but the tutor list seems to be for questions generally encountered by relatively new Pyt

General questions - where & how

2010-06-04 Thread Uriah Eisenstein
Hi all, I'm relatively new to Python and have a few questions. Frankly, it took me a while to find on python.org what seems like a suitable place to post my questions. However, I'd like to check the archives and see if they haven't been discussed already... But I don't find a Search function. Is th

Re: Issue with xml iterparse

2010-06-04 Thread bfrederi
On Jun 3, 4:13 pm, bfrederi wrote: > On Jun 3, 3:59 pm, Chris Rebert wrote: > > > > > On Thu, Jun 3, 2010 at 1:44 PM, bfrederi wrote: > > > I am using lxml iterparse and running into a very obscure error. When > > > I run iterparse on a file, it will occasionally return an element that > > > has

Re: weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-04 Thread Peter Otten
kirby.ur...@gmail.com wrote: > Here we are in an Eclipse pydev console, running Python 3.1.2. For > the most part, everything is working great. > > However... > import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) > C:\Python31\python.exe 3.1.2 (r312:79149, Mar 2

Re: Python Forum

2010-06-04 Thread Emile van Sebille
On 6/3/2010 10:41 PM Steven D'Aprano said... On Thu, 03 Jun 2010 06:15:20 -0400, Adam Tauno Williams wrote: Most people use this list via e-mail, How do you know? Do you have evidence for this, or are you just making it up? Is there now a non-email method of posting to this list? Emile

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-04 Thread Philip Semanchuk
On Jun 4, 2010, at 12:06 PM, Bryan wrote: Emin.shopper wrote: dmtr wrote: I'm still unconvinced that it is a memory fragmentation problem. It's very rare. You could be right. I'm not an expert on python memory management. But if it isn't memory fragmentation, then why is it that I can

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-04 Thread Bryan
Emin.shopper wrote: > dmtr wrote: > > I'm still unconvinced that it is a memory fragmentation problem. It's > > very rare. > > You could be right. I'm not an expert on python memory management. But > if it isn't memory fragmentation, then why is it that I can create > lists which use up 600 more MB

Re: How to generate execute file that include enthought.traits.api , enthought.traits.ui.api ?

2010-06-04 Thread Robert Kern
On 6/3/10 10:05 PM, ray wrote: Hi all, I code the program that using enthought.traits.api , enthought.traits.ui.api. I want to genereate execute file.I try PY2EXE,bb- freeze,cx_freeze,Pyinstaller ,but the execute files can not run successful. The attach file is my source code. My environme

Re: Python Forum

2010-06-04 Thread Michael Torrie
On 06/03/2010 04:15 AM, Adam Tauno Williams wrote: > The best solution I've seen is what is used by the Mono project; > which provides both a "web forum" and a mail list interface. > > > I just checked the archives

weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-04 Thread kirby.ur...@gmail.com
Here we are in an Eclipse pydev console, running Python 3.1.2. For the most part, everything is working great. However... >>> import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) C:\Python31\python.exe 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] >

Re: parse xml with invalid chars

2010-06-04 Thread Someone Something
What d'ya mean hang? On Fri, Jun 4, 2010 at 10:16 AM, Roman Makurin wrote: > Hi all > > Last time i have a big problem, i need parse xml files > which have invalid xml chars outside of CDATA and xml > parser hangs everytime on such files. Is there any way > to parse such files ??? > > thanks > >

Re: Missing DLL in win98

2010-06-04 Thread Chris W
On Jun 4, 8:53 am, Spyder42 wrote: > On Fri, 04 Jun 2010 15:32:15 +0200, Christian Heimes > > wrote: > >> So your response is either, you don't know if there is a fix, or 'No > >> way in h377.' You couldn't figure out by my post that I already knew > >> that? > > >Let me paraphrase my answer: > >

Re: threading and atexit: different behaviour in python2.6 from 2.5

2010-06-04 Thread MRAB
Alan wrote: Hi there, That's another try to get help about this issue I am facing. To help you to help me here goes a simple example. This is a very simplification of a very complex code. thread_ping.py begin import time import sys import atexit from

Re: Missing DLL in win98

2010-06-04 Thread nn
On Jun 4, 9:53 am, Spyder42 wrote: > On Fri, 04 Jun 2010 15:32:15 +0200, Christian Heimes > > wrote: > >> So your response is either, you don't know if there is a fix, or 'No > >> way in h377.' You couldn't figure out by my post that I already knew > >> that? > > >Let me paraphrase my answer: > >

Re: Python Forum

2010-06-04 Thread Jim Byrnes
Steven D'Aprano wrote: On Thu, 03 Jun 2010 22:05:19 -0700, Phlip wrote: On Jun 3, 9:54 pm, Steven D'Aprano wrote: I don't know what rubbish ISPs you're dealing with You've heard of a little fly-by-night outfit called AT&T? Yes I have. Aren't they the people who were engaged in a long-run

Re: Missing DLL in win98

2010-06-04 Thread Spyder42
On Fri, 04 Jun 2010 15:32:15 +0200, Christian Heimes wrote: >> So your response is either, you don't know if there is a fix, or 'No >> way in h377.' You couldn't figure out by my post that I already knew >> that? > >Let me paraphrase my answer: > >You can't run Python 2.6 on Windows 98 because w

Wing IDE 3.2.8 released: Adds Python 2.7 support

2010-06-04 Thread Wingware
Hi, Wingware has released version 3.2.8 of Wing IDE, an integrated development environment designed specifically for the Python programming language. This release includes the following minor features and improvements: * Support for Python 2.7 * Partially updated French localization of the GUI

Re: Plain simple unix timestamp with an HTTP GET

2010-06-04 Thread Ross
On Jun 3, 11:20 pm, livibetter wrote: > This? > > hwclock --utc --set --date="$(datestr="$(curlhttp://208.66.175.36:13/ > 2>/dev/null | cut -d \  -f 2-3)" ; echo ${datestr//-//})" > > Only hwclock, curl, cut, and Bash. > > PS. I didn't know I can set the time via hwclock, learned from Paul's > pos

Re: Missing DLL in win98

2010-06-04 Thread Christian Heimes
> So your response is either, you don't know if there is a fix, or 'No > way in h377.' You couldn't figure out by my post that I already knew > that? Let me paraphrase my answer: You can't run Python 2.6 on Windows 98 because we have dropped support for any Windows older than Windows 2000 SP4. I

Re: Missing DLL in win98

2010-06-04 Thread Spyder42
On Fri, 04 Jun 2010 14:50:28 +0200, Christian Heimes wrote: > >Python 2.6 is not supported on Windows 98 and earlier. You need at least >Windows 2000 with a recent service pack. > >Christian So your response is either, you don't know if there is a fix, or 'No way in h377.' You couldn't figure o

Re: Python Forum

2010-06-04 Thread Pierre Quentel
On 4 juin, 07:11, Steven D'Aprano wrote: > On Thu, 03 Jun 2010 03:16:03 -0700, Pierre Quentel wrote: > > So the OP's initiative should be an incentive to think on the format of > > the interaction between all the range of Python users, from newbees to > > gurus. We are in the 2.0 era, with social

Re: [python] pass the name of args

2010-06-04 Thread Chris Rebert
On Fri, Jun 4, 2010 at 4:32 AM, macm wrote: > Hi Folks > > def myDef(x) >        doSomething x >        result = x. >        return coolThings > - > > WhatYourName = ('python','is','cool') > > myDef(WhatYourName) > > so what I am looking for in myDef > >        

Re: Missing DLL in win98

2010-06-04 Thread Christian Heimes
Am 04.06.2010 14:38, schrieb Spyder42: > I hope this is the right place to ask this, and appologise if it's > not. I'm trying to install 2.6.5 in Win98 se final. It says "a > required dll could not be run". Do I have to upgrade my whole OS just > to install this, or is there a fix I can apply to 98

Missing DLL in win98

2010-06-04 Thread Spyder42
I hope this is the right place to ask this, and appologise if it's not. I'm trying to install 2.6.5 in Win98 se final. It says "a required dll could not be run". Do I have to upgrade my whole OS just to install this, or is there a fix I can apply to 98 to make it work. The installer doesn't say wha

Re: one more exception newbie query

2010-06-04 Thread Alf P. Steinbach
* Payal, on 04.06.2010 12:10: Hi all, In http://docs.python.org/tutorial/errors.html#handling-exceptions it says, |>>> try: | ...raise Exception('spam', 'eggs') Why would I want to use a class for exception? I could simply use raise w/o it? Also the help() says, class Exception(BaseExcepti

Re: questions about how to parse a string and put it in a dictionary

2010-06-04 Thread Tim Chase
On 06/03/2010 09:21 PM, joblack wrote: I've got a string which (without any CR or LF) consists of 'attribute1=attribute_value;attribute2=attribute_value2; ...' and I want them to read in a dictionary so that the attribute name is the key and the attribute value is the data. Any ideas for an im

[python] pass the name of args

2010-06-04 Thread macm
Hi Folks def myDef(x) doSomething x result = x. return coolThings - WhatYourName = ('python','is','cool') myDef(WhatYourName) so what I am looking for in myDef result = WhatYourName -- again :

Re: great

2010-06-04 Thread Jean-Michel Pichavant
joblack wrote: Great - it works. Thanks a lot. Thread of the week :) JM -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >