Re: Question on the "csv" library

2009-08-27 Thread Simon Brunning
2009/8/28 John Machin : > > Mark, there exist parallel universes the denizens of which use strange > notation e.g. 1.234,56 instead of 1,234.56 When displaying data, sure. > and would you believe they > use ';' instead of ',' as a list separator ... CSV is a data transfer format, not a display f

Re: Learning Python advanced features

2009-08-27 Thread jvpic
Bruno Desthuilliers a écrit : jvpic a écrit : Hi, Learning Python, I understand the mechanism of : closure, __new__, descriptors, decorators and __metaclass__, but I interrogate myself on the interest of those technics ? May somebody explain me the interest ? Didn't like my answers on f.c

Re: why python got less developers ?

2009-08-27 Thread Chris Withers
Esam Qanadeely wrote: .NET= i meant all .NET languages What? You mean like Python? ;-) Google IronPython ya troll... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Move dictionary from instance to class level

2009-08-27 Thread Frank Millman
Dave Angel wrote: > OK, that makes good sense. And I withdraw any suggestion to use pickling, > since that could be subject to hacking. > > It now appears that the messages are only incidentally GUI events. And > that you would be well advised to make every possible event a separate > messag

Re: Transforming a str to an operator

2009-08-27 Thread Stephen Hansen
> > > I would use the following approach: > > Abviously the OP is a python baby noob and casting your irrational > fear (and many others irrational fears) of eval at him is akin to > tales of Chupacabras running a muck in the jungle sucking the blood > from live goats in the twilight hours. I use e

Re: why python got less developers ?

2009-08-27 Thread r
On Aug 27, 7:34 pm, Deep_Feelings wrote: > python got relatively fewer numbers of developers than other high > level languages like .NET , java .. etc  why ? Oh, and why on god's green would you ever compare Java (*puke*) and Python in the same breath? You say Python is a "high-level-language"? W

Re: why python got less developers ?

2009-08-27 Thread Esam Qanadeely
On Aug 28, 8:27 am, Tim Roberts wrote: > Deep_Feelings wrote: > > >python got relatively fewer numbers of developers than other high > >level languages like .NET , java .. etc  why ? > > How do you know, and why does it matter? > > By the way, .NET is not a language.  I assume you meant C#. > --

Re: Does Class implements Interface?

2009-08-27 Thread Max Landaeus
Emanuele D'Arrigo wrote: On Aug 27, 9:42 pm, Jonathan Gardner wrote: Have you heard of duck typing? Yes. Ignore all those things and rely on human (aka natural language) documentation. That is, if you want to see if a class will work for an interface, go read the docs on the int

Re: why python got less developers ?

2009-08-27 Thread Tim Roberts
Deep_Feelings wrote: > >python got relatively fewer numbers of developers than other high >level languages like .NET , java .. etc why ? How do you know, and why does it matter? By the way, .NET is not a language. I assume you meant C#. -- Tim Roberts, t...@probo.com Providenza & Boekelheide,

Re: Transforming a str to an operator

2009-08-27 Thread r
On Aug 27, 11:35 pm, Ben Finney wrote: > In general, ‘eval’ on unsanitised input is not the answer. Yes i agree. > I would use the following approach: Abviously the OP is a python baby noob and casting your irrational fear (and many others irrational fears) of eval at him is akin to tales of Ch

Re: why python got less developers ?

2009-08-27 Thread Esam Qanadeely
i meant fast enough for most (but not all) applications -- http://mail.python.org/mailman/listinfo/python-list

Re: why python got less developers ?

2009-08-27 Thread Esam Qanadeely
who cares if a language is compiled or interpreted as long as it runs and perform the function. second thing is : even if java is faster than python , unless you are making performance critical operations : who cares? computers are getting faster all the time and languages like python or ruby are

Re: why python got less developers ?

2009-08-27 Thread Stefan Behnel
r wrote: > As long as Java > can be complied strait to machine code I think you meant "compared" here. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Transforming a str to an operator

2009-08-27 Thread Xavier Ho
On Fri, Aug 28, 2009 at 2:35 PM, Ben Finney > wrote: >import operator > >op_funcs = { >'+': operator.add, >'-': operator.sub, >'*': operator.mul, >'/': operator.div, >} > >num_1 = int(raw_input('Enter the first number: ')) >num_2 = int(raw_i

Re: Transforming a str to an operator

2009-08-27 Thread Ben Finney
Duke Normandin writes: > Hey > > I'm a Python noob > > So far so good! > > I've written the following: > > num1 = raw_input('Enter the first number: ') > num2 = raw_input('Enter the second number: ') > op = raw_input('Select one of the following [+-*/]: ') > print 'The answer is: ', int(n

Re: Question on the "csv" library

2009-08-27 Thread John Machin
On Aug 28, 6:44 am, Mark Lawrence wrote: > vsoler wrote: > > On Aug 27, 9:42 pm, Andreas Waldenburger > > > 1- the csv file was generated with Excel 2007; no prompts for what the > > separator should be; Excel has used ";" by default, without asking > > anything > > I find this difficult to belie

Re: Transforming a str to an operator

2009-08-27 Thread Stephen Hansen
> > num1 = raw_input('Enter the first number: ') > num2 = raw_input('Enter the second number: ') > op = raw_input('Select one of the following [+-*/]: ') > print 'The answer is: ', int(num1), eval(op), int(num2) > > > How do I convert the contents of "op"

Re: Transforming a str to an operator

2009-08-27 Thread r
On Aug 27, 10:52 pm, Duke Normandin wrote: > How do I convert the contents of "op" from a string to an actual > arithmetic operator? eval() does not seem to be the answer. TIA! Try this.. >>> op = '+' >>> one = '1' >>> two = '2' >>> one+op+two '1+2' >>> eval(one+op+two) 3 you could also use s

Re: Transforming a str to an operator

2009-08-27 Thread Xavier Ho
On Fri, Aug 28, 2009 at 1:52 PM, Duke Normandin wrote: > How do I convert the contents of "op" from a string to an actual > arithmetic operator? eval() does not seem to be the answer. TIA! Maybe you were looking for print eval(num1 + op + num2) # it's a little ugly string concatenation. Hm? (

Transforming a str to an operator

2009-08-27 Thread Duke Normandin
Hey I'm a Python noob So far so good! I've written the following: num1 = raw_input('Enter the first number: ') num2 = raw_input('Enter the second number: ') op = raw_input('Select one of the following [+-*/]: ') print 'The answer is: ', int(num1), eval(op), int(num2)

Re: Need help with Python scoping rules

2009-08-27 Thread Xavier Ho
On Fri, Aug 28, 2009 at 1:48 PM, Xavier Ho wrote: > > Class already provides some kind of scoping/namespace, that is the locals() > method for the class. What is pypothetical about this, if you could > elaborate? > Obviously that was supposed to be "hypothetical". Oops. -- http://mail.python.or

Re: Need help with Python scoping rules

2009-08-27 Thread Xavier Ho
On Fri, Aug 28, 2009 at 1:27 PM, Miles Kaufmann wrote: > You're right, of course. If I had been thinking properly, I would have > posted this: > > ... the suite namespace and the class namespace would get out of sync when > different objects were assigned to the class namespace: I'm not an exp

Re: why python got less developers ?

2009-08-27 Thread r
On Aug 27, 7:34 pm, Deep_Feelings wrote: > python got relatively fewer numbers of developers than other high > level languages like .NET , java .. etc  why ? Ugh? Well maybe if you put some deep_thoughts into this conundrum you may reveal the answer to your self. Python is an interpreted "scripti

Re: Need help with Python scoping rules

2009-08-27 Thread Miles Kaufmann
On Aug 27, 2009, at 4:49 PM, kj wrote: Miles Kaufmann writes: Guido's design justifications: http://mail.python.org/pipermail/python-dev/2000-November/010598.html Ah! Clarity! Thanks! How did you find this? Did you know of this post already? Or is there some special way to search Guido'

Re: why python got less developers ?

2009-08-27 Thread Benjamin Kaplan
On Thu, Aug 27, 2009 at 10:12 PM, Esam Qanadeely wrote: > On Aug 28, 3:46 am, Chris Rebert wrote: >> On Thu, Aug 27, 2009 at 5:34 PM, Deep_Feelings wrote: >> > python got relatively fewer numbers of developers than other high >> > level languages like .NET , java .. etc  why ? >> >> We lack Sun an

Re: Need help with Python scoping rules

2009-08-27 Thread Stephen Fairchild
kj wrote: > But this unfortunate situation is already possible, because one > can already define > > class C: > x = 1 > def foo(self): > print C.x > print self.x How is this a problem? There is no ambiguity between the global scope and the local from within foo. >From wi

Re: why python got less developers ?

2009-08-27 Thread Esam Qanadeely
On Aug 28, 3:46 am, Chris Rebert wrote: > On Thu, Aug 27, 2009 at 5:34 PM, Deep_Feelings wrote: > > python got relatively fewer numbers of developers than other high > > level languages like .NET , java .. etc  why ? > > We lack Sun and Microsoft's massive marketing departments. :) > > Cheers, > C

Re: regexp help

2009-08-27 Thread Paul McGuire
On Aug 27, 1:15 pm, Bakes wrote: > If I were using the code: > > (?P[0-9]+) > > to get an integer between 0 and 9, how would I allow it to register > negative integers as well? With that + sign in there, you will actually get an integer from 0 to 9... -- Paul -- http://mail.pyth

Re: Python for professsional Windows GUI apps?

2009-08-27 Thread Peter Decker
On Wed, Aug 26, 2009 at 4:47 PM, David C Ullrich wrote: > On Mon, 24 Aug 2009 22:22:20 -0700, sturlamolden wrote: > >> On 25 Aug, 05:56, Peter Decker wrote: >> >>> I use the Dabo Class Designer to visually design my forms. So what's >>> you're point? :) >> >> Nothing, except lobbying for wxFormBu

Re: Need help with Python scoping rules

2009-08-27 Thread Xavier Ho
On Fri, Aug 28, 2009 at 9:49 AM, kj wrote: > > Miles Kaufmann writes: > > >...because the suite > >namespace and the class namespace would get out of sync when different > >objects were assigned to the class namespace: > > >class C: > > x = 1 > > def foo(self): > > print x > > pr

Re: [OT] How do I reply to a thread by sending a message to python-list@python.org

2009-08-27 Thread Ben Finney
Terry Reedy writes: > In particular, because there is no indication that it is an exact > duplicate of what I will also find on the list itself. Please use > reply instead of reply-all. Better: If you don't want to reply to the author directly, and you don't want to reply to everyone, don't use

Re: break unichr instead of fix ord?

2009-08-27 Thread rurpy
On 08/26/2009 11:51 PM, "Martin v. Löwis" wrote: >[...] >> But regardless, the significant question is, what is >> the reason for having ord() (and unichr) not work for >> surrogate pairs and thus not usable with a large number >> of unicode characters that Python otherwise supports? > >

Re: why python got less developers ?

2009-08-27 Thread Gary Herron
Deep_Feelings wrote: python got relatively fewer numbers of developers than other high level languages like .NET , java .. etc why ? Perhaps because we value QUALITY over QUANTITY ... Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: why python got less developers ?

2009-08-27 Thread MRAB
Deep_Feelings wrote: python got relatively fewer numbers of developers than other high level languages like .NET , java .. etc why ? Fewer needed? -- http://mail.python.org/mailman/listinfo/python-list

Re: why python got less developers ?

2009-08-27 Thread Chris Rebert
On Thu, Aug 27, 2009 at 5:34 PM, Deep_Feelings wrote: > python got relatively fewer numbers of developers than other high > level languages like .NET , java .. etc  why ? We lack Sun and Microsoft's massive marketing departments. :) Cheers, Chris -- http://blog.rebertia.com -- http://mail.python

Re: Annoying octal notation

2009-08-27 Thread Mel
Steven D'Aprano wrote: > Leading zeroes in decimal numbers are *very* common in dates and times. In banking too, according to someone at work today. Mel. -- http://mail.python.org/mailman/listinfo/python-list

why python got less developers ?

2009-08-27 Thread Deep_Feelings
python got relatively fewer numbers of developers than other high level languages like .NET , java .. etc why ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Algorithms as objects?

2009-08-27 Thread Bearophile
Chris Rebert: > It sounds like you're describing the Strategy Pattern > (http://en.wikipedia.org/wiki/Strategy_pattern). > > To have objects callable like functions, just implement the  __call__ > special method in your class(es): Please, can't you just use a bit of functional-style programming?

Re: Need help with Python scoping rules

2009-08-27 Thread kj
Miles Kaufmann writes: >On Aug 26, 2009, at 1:11 PM, kj wrote: >> I think I understand the answers well enough. What I *really* >> don't understand is why this particular "feature" of Python (i.e. >> that functions defined within a class statement are forbidden from >> "seeing" other identifier

printing from child process in Tkinter window

2009-08-27 Thread Dan Upton
Hi all, I've been messing with this for a couple hours now but can't make it work. Basically I have a Tkinter GUI that creates a child process via subprocess.Popen, and I would like to capture the child process's output to display it in a Text widget in the GUI. Relevant snippets: def click_star

PyGTK problems after Linux update...

2009-08-27 Thread barcaroller
I use a python-based program called 'meld' which worked fine until my latest Fedora11/KDE4.3 update; it now gives me the following error: prompt> meld /usr/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8 Meld requires pygtk 2.8.0 or hig

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-27 Thread Mensanator
On Aug 27, 2:26 pm, Piet van Oostrum wrote: > > Mensanator (M) wrote: > >M> On Aug 26, 4:59 pm, Piet van Oostrum wrote: > >>> > Mensanator (M) wrote: > >>> >M> That's my point. Since the common usage of "binary" is for > >>> >M> Standard Positional Number System of Radix 2, it follows >

Re: Algorithms as objects?

2009-08-27 Thread Chris Rebert
On Thu, Aug 27, 2009 at 4:05 PM, Kreso wrote: > > I am writing an application that essentially calculates set of numbers, > say N1, N2, ..., where they can be calculated by several different > algorithms. (One should be able to choose the algorithm at run time.) > In each algorithm one starts from

Algorithms as objects?

2009-08-27 Thread Kreso
I am writing an application that essentially calculates set of numbers, say N1, N2, ..., where they can be calculated by several different algorithms. (One should be able to choose the algorithm at run time.) In each algorithm one starts from a set of functions, say f1, f2, ..., which are then t

Re: Protecting against callbacks queuing up?

2009-08-27 Thread MRAB
MRAB wrote: Esben von Buchwald wrote: Dennis Lee Bieber wrote: The only other thing I could suggest is exactly what is done on: http://pys60.garage.maemo.org/doc/s60/node59.html Initialize a counter value to 0, then increment it in the callback, only doing REAL work every n calls.

Re: How to unencode a string

2009-08-27 Thread Chris Rebert
On Thu, Aug 27, 2009 at 2:49 PM, Chris Rebert wrote: > On Thu, Aug 27, 2009 at 2:10 PM, jakecjacobson wrote: >> This seems like a real simple newbie question but how can a person >> unencode a string?  In Perl I use something like: "$part=~ s/\%([A-Fa- >> f0-9]{2})/pack('C', hex($1))/seg;" >> >> If

Re: Protecting against callbacks queuing up?

2009-08-27 Thread MRAB
Esben von Buchwald wrote: Dennis Lee Bieber wrote: The only other thing I could suggest is exactly what is done on: http://pys60.garage.maemo.org/doc/s60/node59.html Initialize a counter value to 0, then increment it in the callback, only doing REAL work every n calls. def doCall

Re: How to unencode a string

2009-08-27 Thread Piet van Oostrum
> jakecjacobson (j) wrote: >j> This seems like a real simple newbie question but how can a person >j> unencode a string? In Perl I use something like: "$part=~ s/\%([A-Fa- >j> f0-9]{2})/pack('C', hex($1))/seg;" >j> If I have a string like Word1%20Word2%20Word3 I want to get Word1 >j> Word2

Re: TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str in windows xp, while making tarfile

2009-08-27 Thread Piet van Oostrum
> Ryniek90 (R) wrote: >>> Ryniek90 (R) wrote: >>> >>> >R> Hahah right. My fault. Must remember to read documentation so many times >R> until I find the solution. Thanks, now works fine. :-) >>> >>> And, by the way, how come the traceback refers to >>> File "bac

Re: Does Class implements Interface?

2009-08-27 Thread Stephen Fairchild
Emanuele D'Arrigo wrote: > Apologies, my fault, I didn't explain that humans are out of the loop > entirely. It's only at runtime that the program obtains the class > object that might or might not conform to an expected interface. In > fact the program might obtain multiple objects and have to de

Re: Protecting against callbacks queuing up?

2009-08-27 Thread Esben von Buchwald
Hendrik van Rooyen wrote: Hmm - now I am really starting to fly by the seat of my pants - but it looks as if your problem is that your routine is basically being called faster than what it can do the processing. So what I would try is to define a global (you should really acquire a lock, bu

Re: Protecting against callbacks queuing up?

2009-08-27 Thread Esben von Buchwald
Dennis Lee Bieber wrote: The only other thing I could suggest is exactly what is done on: http://pys60.garage.maemo.org/doc/s60/node59.html Initialize a counter value to 0, then increment it in the callback, only doing REAL work every n calls. def doCallback(self):

Re: variables of the class are not available as default values?

2009-08-27 Thread seanacais
On Aug 27, 5:44 pm, Chris Rebert wrote: > On Thu, Aug 27, 2009 at 2:37 PM, seanacais wrote: > > I'm working on a program where I wish to define the default value of a > > method as a value that was set in __init__.  I get a compilation error > > saying that self is undefined. > > > As always a cod

Re: Does Class implements Interface?

2009-08-27 Thread Jonathan Gardner
On Aug 27, 3:09 pm, "Emanuele D'Arrigo" wrote: > On Aug 27, 9:42 pm, Jonathan Gardner > wrote: > > > Have you heard of duck typing? > > Yes. > > I was just wondering then if this has been somewhat dealt with and has > been wrapped in a neat package, set of functions, recipe or pattern. > As a jo

Re: Does Class implements Interface?

2009-08-27 Thread Jonathan Gardner
On Aug 27, 3:09 pm, "Emanuele D'Arrigo" wrote: > > Apologies, my fault, No apology is necessary. > I didn't explain that humans are out of the loop > entirely. It's only at runtime that the program obtains the class > object that might or might not conform to an expected interface. In > fact the

Re: How to unencode a string

2009-08-27 Thread Stephen Fairchild
jakecjacobson wrote: > This seems like a real simple newbie question but how can a person > unencode a string? In Perl I use something like: "$part=~ s/\%([A-Fa- > f0-9]{2})/pack('C', hex($1))/seg;" > > If I have a string like Word1%20Word2%20Word3 I want to get Word1 > Word2 Word3. Would also

Re: Does Class implements Interface?

2009-08-27 Thread Emanuele D'Arrigo
On Aug 27, 9:42 pm, Jonathan Gardner wrote: > Have you heard of duck typing? Yes. > Ignore all those things and rely on human (aka natural language) > documentation. That is, if you want to see if a class will work for an > interface, go read the docs on the interface (or rather, what the > func

Re: How to unencode a string

2009-08-27 Thread MRAB
jakecjacobson wrote: This seems like a real simple newbie question but how can a person unencode a string? In Perl I use something like: "$part=~ s/\%([A-Fa- f0-9]{2})/pack('C', hex($1))/seg;" If I have a string like Word1%20Word2%20Word3 I want to get Word1 Word2 Word3. Would also like to han

Re: Python on the Web

2009-08-27 Thread Phil
Haha. While I don't disagree with you, I seem to be under the impression that you think I haven't been reading the web where nearly every blog post complains about the abundance of Python frameworks. The thing is, most of the frameworks being commented on in such a way are 'microframeworks' that pr

Re: regexp help

2009-08-27 Thread Mart.
On Aug 27, 7:15 pm, Bakes wrote: > If I were using the code: > > (?P[0-9]+) > > to get an integer between 0 and 9, how would I allow it to register > negative integers as well? -? -- http://mail.python.org/mailman/listinfo/python-list

Re: variables of the class are not available as default values?

2009-08-27 Thread Andre Engels
On Thu, Aug 27, 2009 at 11:37 PM, seanacais wrote: > I'm working on a program where I wish to define the default value of a > method as a value that was set in __init__.  I get a compilation error > saying that self is undefined. > > As always a code snippet helps :-) > > class foo: >    def __init

Re: How to unencode a string

2009-08-27 Thread Chris Rebert
On Thu, Aug 27, 2009 at 2:10 PM, jakecjacobson wrote: > This seems like a real simple newbie question but how can a person > unencode a string?  In Perl I use something like: "$part=~ s/\%([A-Fa- > f0-9]{2})/pack('C', hex($1))/seg;" > > If I have a string like Word1%20Word2%20Word3 I want to get Wo

Re: variables of the class are not available as default values?

2009-08-27 Thread Chris Rebert
On Thu, Aug 27, 2009 at 2:37 PM, seanacais wrote: > I'm working on a program where I wish to define the default value of a > method as a value that was set in __init__.  I get a compilation error > saying that self is undefined. > > As always a code snippet helps :-) > > class foo: >    def __init_

variables of the class are not available as default values?

2009-08-27 Thread seanacais
I'm working on a program where I wish to define the default value of a method as a value that was set in __init__. I get a compilation error saying that self is undefined. As always a code snippet helps :-) class foo: def __init__(self, maxvalue): self.maxvalue = maxvalue sel

An assessment of Tkinter and IDLE

2009-08-27 Thread r
- Tkinter and IDLE Shortfalls - *The following is an assessment of Tkinter as i have experienced it. Even with all the problems i list below i strongly believe Tkinter is a great starter GUI toolkit and we (the

TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str in windows xp, while making tarfile

2009-08-27 Thread Ryniek90
> >> Ryniek90 (R) wrote: >> > > >> R> Hahah right. My fault. Must remember to read documentation so many times >> R> until I find the solution. Thanks, now works fine. :-) >> > > And, by the way, how come the traceback refers to > File "backuper.py", line 197, in >

Re: [OT] How do I reply to a thread by sending a message to python-list@python.org

2009-08-27 Thread Aahz
In article , Terry Reedy wrote: >David House wrote: >> 2009/8/27 Terry Reedy : >>> >>> reply-all may send duplicate messages to the author. Not sure of >>> this list. >> >> I'm fairly sure Mailman deals with that. > >Nope. I got a duplicate sent to my mailbox, which I hate. More precisely, there

Re: Python Telnet client

2009-08-27 Thread exarkun
On 09:06 pm, nbdar...@gmail.com wrote: Is there telnet client in python? i want to write NetHack telnet GUI app) The Python stdlib has a module named telnetlib which offers rudamentary telnet support. Twisted includes twisted.conch.telnet which implements a much more complete telnet library.

How to unencode a string

2009-08-27 Thread jakecjacobson
This seems like a real simple newbie question but how can a person unencode a string? In Perl I use something like: "$part=~ s/\%([A-Fa- f0-9]{2})/pack('C', hex($1))/seg;" If I have a string like Word1%20Word2%20Word3 I want to get Word1 Word2 Word3. Would also like to handle special characters

Re: Python Telnet client

2009-08-27 Thread Chris Rebert
On Thu, Aug 27, 2009 at 2:06 PM, Darvin wrote: > Is there telnet client in python? > i want to write NetHack telnet GUI app) http://docs.python.org/library/telnetlib.html Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Python Telnet client

2009-08-27 Thread Darvin
Is there telnet client in python? i want to write NetHack telnet GUI app) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on the Web

2009-08-27 Thread Aahz
In article , Phil wrote: > >My interest in Python 3.1 was actually to develop a framework. Again, >I can feel the flames. :) I understand there are enough frameworks but >I actually have no applications that I wish to develop. I enjoy >developing these kinds of things from scratch as a learning >

Re: [OT] How do I reply to a thread by sending a message to python-list@python.org

2009-08-27 Thread Terry Reedy
Terry Reedy wrote: David House wrote: 2009/8/27 Terry Reedy : reply-all may send duplicate messages to the author. Not sure of this list. I'm fairly sure Mailman deals with that. Nope. I got a duplicate sent to my mailbox, which I hate. In particular, because there is no indication that i

Re: Learning Python advanced features

2009-08-27 Thread Jonathan Gardner
On Aug 27, 5:13 am, jvpic wrote: > Hi, > > Learning Python, I understand the mechanism of : closure, __new__, > descriptors, decorators and __metaclass__, but I interrogate myself on > the interest of those technics ? > > May somebody explain me the interest ? > I assume you are asking, "Why do t

Re: Does Class implements Interface?

2009-08-27 Thread Jonathan Gardner
On Aug 27, 6:16 am, "Emanuele D'Arrigo" wrote: > Greetings everybody, > > let's say I have a Class C and I'd like to verify if it implements > Interface I. If I is available to me as a class object I can use > issubclass(C, I) and I can at least verify that I is a superclass of > C. There are a co

Re: Question on the "csv" library

2009-08-27 Thread Mark Lawrence
vsoler wrote: On Aug 27, 9:42 pm, Andreas Waldenburger wrote: On Thu, 27 Aug 2009 21:36:28 +0200 Andreas Waldenburger wrote: [snip] Might I humbly suggest sheet = list(spamReader) # ? Oh, and while I'm humbly suggesting: spam_reader instead of spamReader or SpamReader or SpamrEadeR or su

Re: Question on the "csv" library

2009-08-27 Thread Andreas Waldenburger
On Thu, 27 Aug 2009 13:12:07 -0700 (PDT) vsoler wrote: > On Aug 27, 9:42 pm, Andreas Waldenburger > wrote: > > [snip what I wrote] > > Thank you for your answers. Let me however make some comments: > > 1- the csv file was generated with Excel 2007; no prompts for what the > separator should b

Re: regexp help

2009-08-27 Thread Peter Pearson
On Thu, 27 Aug 2009 11:15:59 -0700 (PDT), Bakes wrote: > If I were using the code: > > (?P[0-9]+) > > to get an integer between 0 and 9, how would I allow it to register > negative integers as well? (?P-?[0-9]+) -- To email me, substitute nowhere->spamcop, invalid->net. -- http://mail.python.o

Re: [OT] How do I reply to a thread by sending a message to python-list@python.org

2009-08-27 Thread Terry Reedy
David House wrote: 2009/8/27 Terry Reedy : reply-all may send duplicate messages to the author. Not sure of this list. I'm fairly sure Mailman deals with that. Nope. I got a duplicate sent to my mailbox, which I hate. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on the "csv" library

2009-08-27 Thread vsoler
On Aug 27, 9:42 pm, Andreas Waldenburger wrote: > On Thu, 27 Aug 2009 21:36:28 +0200 Andreas Waldenburger > > wrote: > > [snip] > > > Might I humbly suggest > > > >>> sheet = list(spamReader)  # ? > > Oh, and while I'm humbly suggesting: > > spam_reader instead of spamReader or SpamReader or Spam

Re: Need help with Python scoping rules

2009-08-27 Thread Piet van Oostrum
> kj (k) wrote: >k> No, the fact() function here represents an internal "helper" >k> function. It is meant to be called only once to help initialize >k> a class variable that would be inconvenient to initialize otherwise; >k> this helper function is not meant to be called from outside the >k

Re: Python on Crays

2009-08-27 Thread Carrie Farberow
I am from Wisconsin -- is there a python group here? Do you have any contact info.? The compute node operating system is Compute Node Linux (CNL). Carrie - Original Message - From: Craig Date: Thursday, August 27, 2009 2:15 pm Subject: Re: Python on Crays To: python-list@python.org, M

Re: Question on the "csv" library

2009-08-27 Thread Andreas Waldenburger
On Thu, 27 Aug 2009 21:36:28 +0200 Andreas Waldenburger wrote: > [snip] > > Might I humbly suggest > > >>> sheet = list(spamReader) # ? > Oh, and while I'm humbly suggesting: spam_reader instead of spamReader or SpamReader or SpamrEadeR or suchlike. Caps are "reserved" for classes. Not a ne

Re: TypeError: _getfullpathname() argument 1 must be (buffer overflow), not str in windows xp, while making tarfile

2009-08-27 Thread Piet van Oostrum
> Ryniek90 (R) wrote: >R> Hahah right. My fault. Must remember to read documentation so many times >R> until I find the solution. Thanks, now works fine. :-) And, by the way, how come the traceback refers to File "backuper.py", line 197, in while the posted code has only 188 lines? -- Pi

Re: Annoying octal notation

2009-08-27 Thread Ethan Furman
MRAB wrote: Ethan Furman wrote: Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on this one. The computing world was vastly

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-27 Thread Piet van Oostrum
> Mensanator (M) wrote: >M> On Aug 26, 4:59 pm, Piet van Oostrum wrote: >>> > Mensanator (M) wrote: >>> >M> That's my point. Since the common usage of "binary" is for >>> >M> Standard Positional Number System of Radix 2, it follows >>> >M> that "unary" is the common usage for Standard P

Re: Question on the "csv" library

2009-08-27 Thread Benjamin Kaplan
On Thu, Aug 27, 2009 at 3:06 PM, vsoler wrote: > > I am trying to read a csv file generated by excel. > > Although I succeed in reading the file, the format that I get is not > suitable for me. > > I've done: > > >>> import csv > >>> spamReader = csv.reader(open('C:\\abc.csv', 'r')) > > >>> print

Re: Annoying octal notation

2009-08-27 Thread Ethan Furman
James Harris wrote: On 27 Aug, 18:31, Ethan Furman wrote: Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on this one. Th

Re: How does the file.seek() work ?

2009-08-27 Thread gert
On Aug 26, 7:28 pm, gert wrote: > On Aug 26, 12:46 am, Graham Dumpleton > wrote: > > > > > On Aug 25, 5:37 am, Tim Chase wrote: > > > > > I want the file pointer set to 100 and overwrite everything from there > > > [snip] > > > > def application(environ, response): > > > >     query=os.path.join

Re: Python on Crays

2009-08-27 Thread Craig
Who the one from wisconsin and did you try the python group in madison maybe they can help. Well i from madison are and i just a newbie with python.What OS you useing? --- On Thu, 8/27/09, Mark Dickinson wrote: > From: Mark Dickinson > Subject: Re: Python on Crays > To: python-list@python.org

Question on the "csv" library

2009-08-27 Thread vsoler
I am trying to read a csv file generated by excel. Although I succeed in reading the file, the format that I get is not suitable for me. I've done: >>> import csv >>> spamReader = csv.reader(open('C:\\abc.csv', 'r')) >>> print spamReader <_csv.reader object at 0x01022E70> >>> for row in spamRe

Re: Annoying octal notation

2009-08-27 Thread James Harris
On 27 Aug, 18:31, Ethan Furman wrote: > Steven D'Aprano wrote: > > A mistake is still a mistake even if it shared with others. > > > Treating its with a lead zero as octal was a design error when it was > > first thought up > > [snippage] > > I have to disagree with you on this one.  The computi

Re: Object Reference question

2009-08-27 Thread Ethan Furman
josef wrote: Thanks to everyone who responded. I will be going with some sort of a = MyClass(name = 'a') format. It's the Python way. For me, it was very hard to accept that EVERYTHING is an object reference. And that there are no object reference names, just string entries in dictionaries. But

Re: Python on Crays

2009-08-27 Thread Mark Dickinson
On Aug 25, 11:34 pm, Carrie Farberow wrote: > Ok, here are links to word documents outlining the commands I executed as > well as the make.log file and the make_install.log file > [links snipped] So from the output of make, it looks as though none of the modules specified in the Modules/Setup fi

Re: regexp help

2009-08-27 Thread Iuri
You can use r"[+-]?\d+" to get positive and negative integers. It returns true to these strings: "+123", "-123", "123" On Thu, Aug 27, 2009 at 3:15 PM, Bakes wrote: > If I were using the code: > > (?P[0-9]+) > > to get an integer between 0 and 9, how would I allow it to register > negative in

regexp help

2009-08-27 Thread Bakes
If I were using the code: (?P[0-9]+) to get an integer between 0 and 9, how would I allow it to register negative integers as well? -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-27 Thread Mensanator
On Aug 26, 10:27 pm, Steven D'Aprano wrote: > On Wed, 26 Aug 2009 18:53:04 -0700, Erik Max Francis wrote: > >> In any case, unary is the standard term for what I'm discussing: > > >>http://en.wikipedia.org/wiki/Unary_numeral_system > This really isn't anywhere near as controversial as you guys

Re: Annoying octal notation

2009-08-27 Thread MRAB
Ethan Furman wrote: Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on this one. The computing world was vastly different when

Re: Annoying octal notation

2009-08-27 Thread Ethan Furman
Steven D'Aprano wrote: A mistake is still a mistake even if it shared with others. Treating its with a lead zero as octal was a design error when it was first thought up [snippage] I have to disagree with you on this one. The computing world was vastly different when that design decision

Re: Need help with Python scoping rules

2009-08-27 Thread Miles Kaufmann
On Aug 26, 2009, at 1:11 PM, kj wrote: I think I understand the answers well enough. What I *really* don't understand is why this particular "feature" of Python (i.e. that functions defined within a class statement are forbidden from "seeing" other identifiers defined within the class statement)

  1   2   >