Re: Transforming a str to an operator

2009-08-28 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 eval all

Re: Move dictionary from instance to class level

2009-08-28 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 message, so

Re: why python got less developers ?

2009-08-28 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: Learning Python advanced features

2009-08-28 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

Re: Question on the csv library

2009-08-28 Thread Simon Brunning
2009/8/28 John Machin sjmac...@lexicon.net: 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,

Re: List iterator thread safety

2009-08-28 Thread Hendrik van Rooyen
On Thursday 27 August 2009 16:50:16 Carl Banks wrote: On Aug 27, 7:25 am, Hendrik van Rooyen hend...@microcorp.co.za wrote: Its not too bad - if you crook a bit - the trick is that you iterate over the list backwards when you are removing stuff based on index, so that the remainder does

Re: Select column from a list

2009-08-28 Thread Xavier Ho
On Fri, Aug 28, 2009 at 5:45 PM, hoffik be...@seznam.cz wrote: Hello, I'm quite new in Python and I have one question. I have a 2D matrix of values stored in list (3 columns, many rows). I wonder if I can select one column without having to go through the list with 'for' command. As far as

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread eb303
On Aug 27, 11:22 pm, r rt8...@gmail.com wrote: - Python offical docs and Tkinter - *The Python docs barely cover anything related to actual Tkinter coding. At the minimum the Tkinter doc page should have a

Select column from a list

2009-08-28 Thread hoffik
Hello, I'm quite new in Python and I have one question. I have a 2D matrix of values stored in list (3 columns, many rows). I wonder if I can select one column without having to go through the list with 'for' command. For example I have list called 'values'. When I write 'values[0]' or

Re: Question on the csv library

2009-08-28 Thread Mark Lawrence
John Machin wrote: On Aug 28, 6:44 am, Mark Lawrence breamore...@yahoo.co.uk wrote: vsoler wrote: On Aug 27, 9:42 pm, Andreas Waldenburger use...@geekmail.invalid 1- the csv file was generated with Excel 2007; no prompts for what the separator should be; Excel has used ; by default, without

Re: break unichr instead of fix ord?

2009-08-28 Thread Martin v. Löwis
The PEP says: * unichr(i) for 0 = i 2**16 (0x1) always returns a length-one string. * unichr(i) for 2**16 = i = TOPCHAR will return a length-one string on wide Python builds. On narrow builds it will raise ValueError. and * ord() is always the

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

2009-08-28 Thread Hendrik van Rooyen
On Thursday 27 August 2009 22:57:44 Terry Reedy wrote: Nope. I got a duplicate sent to my mailbox, which I hate. 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. If I do that,

Re: Algorithms as objects?

2009-08-28 Thread Diez B. Roggisch
Kreso schrieb: 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, ...,

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

2009-08-28 Thread Xavier Ho
On Fri, Aug 28, 2009 at 6:18 PM, Hendrik van Rooyen hend...@microcorp.co.za wrote: It would really be nice if the reply would go to the list, but for the digest versions, at least, it does not. I'm on a few other lists. The Python ones are the only ones that I have to manually change. The

Sending email

2009-08-28 Thread Fencer
Hello, I'm using Python version 2.6.2 and I discovered it has built-in libraries for sending email (imports smtplib and email). On the web I discovered how to send mail through smtp.gmail.com: mail_server = smtplib.SMTP() mail_server.connect('smtp.gmail.com') mail_server.ehlo()

Re: Need help with Python scoping rules

2009-08-28 Thread Bruno Desthuilliers
kj a écrit : In 4a967b2f$0$19301$426a7...@news.free.fr Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid writes: The only thing one is entitled to expect when learning a new language is that the language's implementation follows the language specs. In fact, the official docs,

Re: Algorithms as objects?

2009-08-28 Thread Bruno Desthuilliers
Kreso a écrit : 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,

Re: Protecting against callbacks queuing up?

2009-08-28 Thread Hendrik van Rooyen
On Friday 28 August 2009 00:42:16 Esben von Buchwald wrote: OK, now things starts to make sense. You tell me to do something like this? def doCallback(self): if self.process_busy==False: self.process_busy=True self.at.after(0.01,self.data_callback)

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

2009-08-28 Thread Bruno Desthuilliers
Chris Rebert a écrit : (snip) Default values are only evaluated once, when the class is defined, clarification target=newcomers s/class/function/ The function objects (defined in a class statement body...) are created before the class object itself. /clarification thus self is not

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

2009-08-28 Thread Ben Finney
Hendrik van Rooyen hend...@microcorp.co.za writes: If I [use the “reply to author” command], then the mail would go just to you, and not to the list at all, which is not what I suspect you want, in view of what you have just said. Right. The common “reply” command in most mail clients means

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

2009-08-28 Thread Xavier Ho
On Fri, Aug 28, 2009 at 6:54 PM, Ben Finney ben+pyt...@benfinney.id.auben%2bpyt...@benfinney.id.au wrote: Fortunately, the messages that come from the list enable any mail client to know the correct address for “reply to list”. It only remains to choose a mail client that knows how to use it.

Re: Select column from a list

2009-08-28 Thread Bruno Desthuilliers
hoffik a écrit : Hello, I'm quite new in Python and I have one question. I have a 2D matrix of values stored in list (3 columns, many rows). I wonder if I can select one column without having to go through the list with 'for' command. Lists don't have columns. What you have is a list of

Re: Select column from a list

2009-08-28 Thread Anthra Norell
Vlastimil Brom wrote: 2009/8/28 hoffik be...@seznam.cz: Hello, I'm quite new in Python and I have one question. I have a 2D matrix of values stored in list (3 columns, many rows). I wonder if I can select one column without having to go through the list with 'for' command. ... I

Re: Select column from a list

2009-08-28 Thread Vlastimil Brom
2009/8/28 hoffik be...@seznam.cz: Hello, I'm quite new in Python and I have one question. I have a 2D matrix of values stored in list (3 columns, many rows). I wonder if I can select one column without having to go through the list with 'for' command. ... I guess, it won't be possible

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

2009-08-28 Thread Albert Hopkins
On Fri, 2009-08-28 at 19:04 +1000, Xavier Ho wrote: On Fri, Aug 28, 2009 at 6:54 PM, Ben Finney ben +pyt...@benfinney.id.au wrote: Fortunately, the messages that come from the list enable any mail client to know the correct address for “reply to list”. It only

Re: why python got less developers ?

2009-08-28 Thread OdarR
On 28 août, 02:47, MRAB pyt...@mrabarnett.plus.com wrote: Deep_Feelings wrote: python got relatively fewer numbers of developers than other high level languages like .NET , java .. etc  why ? Fewer needed? excellent answer. LOL. Olivier --

Re: Question on the csv library

2009-08-28 Thread Andreas Waldenburger
On Fri, 28 Aug 2009 09:03:49 +0100 Mark Lawrence breamore...@yahoo.co.uk wrote: p.s. is it separator or seperator, after 50+ years I still can't remember? The former. It's cognate to English part if that helps any. /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/python-list

Re: Protecting against callbacks queuing up?

2009-08-28 Thread Esben von Buchwald
It seems to solve the problem. What I did: def contextDataHandler(self): self.contextdata.process_busy=True self.services.findServices() self.drawDisplay() self.contextdata.process_busy=False def doCallback(self): self.at.cancel() if

Re: Python on the Web

2009-08-28 Thread Bruno Desthuilliers
Phil a écrit : When I gave that arbitrary percentage, I was basing it off of the information I had seen with regards to launching applications built with existing frameworks using lighttpd. I do realize I was missing a lot of information by looking up something that specific. Indeed !-) I

Re: Learning Python advanced features

2009-08-28 Thread Bruno Desthuilliers
jvpic a écrit : 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

Re: Learning Python advanced features

2009-08-28 Thread Bruno Desthuilliers
Jonathan Gardner a écrit : On Aug 27, 5:13 am, jvpic jv...@free.fr 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

Re: why python got less developers ?

2009-08-28 Thread Martin P. Hellwig
Esam Qanadeely wrote: 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

Re: Object's nesting scope

2009-08-28 Thread Bruno Desthuilliers
zaur a écrit : On 26 авг, 17:13, Diez B. Roggisch de...@nospam.web.de wrote: Whom am we to judge? Sure if you propose this, you have some usecases in mind - how about you present these Ok. Here is a use case: object initialization. For example, person = Person(): name = john age = 30

Re: Sending email

2009-08-28 Thread 7stud
On Aug 28, 2:37 am, Fencer no.i.d...@want.mail.from.spammers.com wrote: Hello, I'm using Python version 2.6.2 and I discovered it has built-in libraries for sending email (imports smtplib and email). On the web I discovered how to send mail through smtp.gmail.com: mail_server = smtplib.SMTP()

Re: Select column from a list

2009-08-28 Thread Piet van Oostrum
hoffik be...@seznam.cz (h) wrote: h Hello, h I'm quite new in Python and I have one question. I have a 2D matrix of h values stored in list (3 columns, many rows). I wonder if I can select one h column without having to go through the list with 'for' command. h For example I have list called

Re: Transforming a str to an operator

2009-08-28 Thread Duke Normandin
On Thu, 27 Aug 2009, Stephen Hansen wrote: 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)

ANN: M2Crypto 0.20.1

2009-08-28 Thread Heikki Toivonen
M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web

Re: Read a content file from a P7M

2009-08-28 Thread Luca
On Fri, Mar 20, 2009 at 4:12 PM, Emanuele Roccae...@linux.it wrote: On 11/03/09 - 05:05, Luca wrote: There is standard or sugested way in python to read the content of a P7M file? I don't need no feature like verify sign, or sign using a certificate. I only need to extract the content file

Re: PyGTK problems after Linux update...

2009-08-28 Thread Thomas Guettler
Looks like your pygtk package does not fit to the installed python package. from glib._glib import * ImportError: /usr/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8 -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail:

Re: Annoying octal notation

2009-08-28 Thread Steven D'Aprano
On Thu, 27 Aug 2009 10:31:04 -0700, 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

Re: Select column from a list

2009-08-28 Thread Bernhard Voigt
I'm quite new in Python and I have one question. I have a 2D matrix of values stored in list (3 columns, many rows). I wonder if I can select one column without having to go through the list with 'for' command. In case you want to due numerical calculations take a look at numpy it has an

Re: why python got less developers ?

2009-08-28 Thread sturlamolden
On 28 Aug, 02:34, Deep_Feelings doctore...@gmail.com wrote: python got relatively fewer numbers of developers than other high level languages like .NET , java .. etc  why ? Because we are better, so fewer are needed. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to unencode a string

2009-08-28 Thread jakecjacobson
On Aug 27, 6:51 pm, Piet van Oostrum p...@cs.uu.nl wrote: jakecjacobson jakecjacob...@gmail.com (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

Re: Does Class implements Interface?

2009-08-28 Thread Zvezdan Petkovic
On Aug 27, 2009, at 9:16 AM, Emanuele D'Arrigo wrote: Are there resources such as tools, recipes, documents or strategies that could help me deal with these issues? I've already looked into the ABC module and the zope.interface. I'm just fishing for more things to look at. You say above that

Re: Annoying octal notation

2009-08-28 Thread MRAB
Steven D'Aprano wrote: On Thu, 27 Aug 2009 10:31:04 -0700, 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

Re: why python got less developers ?

2009-08-28 Thread Jinha Jung
On Aug 28, 9:55 am, sturlamolden sturlamol...@yahoo.no wrote: On 28 Aug, 02:34, Deep_Feelings doctore...@gmail.com wrote: python got relatively fewer numbers of developers than other high level languages like .NET , java .. etc  why ? Because we are better, so fewer are needed. That makes

Re: why python got less developers ?

2009-08-28 Thread Steven D'Aprano
On Thu, 27 Aug 2009 17:34:17 -0700, Deep_Feelings wrote: python got relatively fewer numbers of developers than other high level languages like .NET , java .. etc why ? Python programmers are the elite. The elite are always fewer than the masses. -- Steven who is three quarters joking --

Re: Transforming a str to an operator

2009-08-28 Thread Duke Normandin
On Thu, 27 Aug 2009, r wrote: On Aug 27, 10:52 pm, Duke Normandin dukeofp...@ml1.net 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'

Re: Sending email

2009-08-28 Thread Fencer
7stud wrote: [snip] Thanks for your reply. After consulting the sysadmins here I was able to get it to work. - Fencer -- http://mail.python.org/mailman/listinfo/python-list

Re: Transforming a str to an operator

2009-08-28 Thread Duke Normandin
On Fri, 28 Aug 2009, Ben Finney wrote: Duke Normandin dukeofp...@ml1.net 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

Re: Algorithms as objects?

2009-08-28 Thread Steven D'Aprano
On Thu, 27 Aug 2009 23:05:41 +, 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 a

write Unicode to sys.out.write without access to sitecustomize.py

2009-08-28 Thread Rob Knop
I would like to tell the system that it's OK to write Unicode to sys.out and sys.err. However, I'm doing this in a CGI script where I don't have access to the system directories, and as such can't use sys.setdefaultencoding in sitecustomize.py. Is there a way to make this happen? -- --Rob

Re: Transforming a str to an operator

2009-08-28 Thread Gabriel Genellina
En Fri, 28 Aug 2009 01:50:37 -0300, Xavier Ho cont...@xavierho.com escribió: On Fri, Aug 28, 2009 at 2:35 PM, Ben Finney ben+pyt...@benfinney.id.auben%2bpyt...@benfinney.id.au wrote: op_funcs = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/':

Modules/packages by GvR?

2009-08-28 Thread gb345
Are there any Python-only modules or packages in the latest releases of Python 2.x or Python 3.x that were largely written by Guido van Rossum? What's the best way to find this out? I know that some modules mention the author(s) in the source code, but this does not seem to be true most of

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

2009-08-28 Thread Mark Lawrence
Xavier Ho wrote: On Fri, Aug 28, 2009 at 6:54 PM, Ben Finney ben+pyt...@benfinney.id.auben%2bpyt...@benfinney.id.au wrote: Fortunately, the messages that come from the list enable any mail client to know the correct address for “reply to list”. It only remains to choose a mail client that

Re: Modules/packages by GvR?

2009-08-28 Thread John Haggerty
How is writing code like a language maintainer going to go towards a philosophic ideal? And more principally why would this be of a benefit. In the philosophic world dressing and acting like Socrates isn't necessarily the same as following his ideals and isn't necessarily being Socratic. On Fri,

Re: write Unicode to sys.out.write without access to sitecustomize.py

2009-08-28 Thread exarkun
On 02:51 pm, rk...@pobox.com wrote: I would like to tell the system that it's OK to write Unicode to sys.out and sys.err. However, I'm doing this in a CGI script where I don't have access to the system directories, and as such can't use sys.setdefaultencoding in sitecustomize.py. Is there

Re: Modules/packages by GvR?

2009-08-28 Thread Matimus
On Aug 28, 7:58 am, gb345 gb...@invalid.com wrote: Are there any Python-only modules or packages in the latest releases of Python 2.x or Python 3.x that were largely written by Guido van Rossum?  What's the best way to find this out?  I know that some modules mention the author(s) in the

Re: why python got less developers ?

2009-08-28 Thread jfabiani
Chris Rebert wrote: On Thu, Aug 27, 2009 at 5:34 PM, Deep_Feelingsdoctore...@gmail.com 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. :) I'm inclined to

Re: Question on the csv library

2009-08-28 Thread Steven Rumbalski
On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com 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 spamReader

Re: Need help with Python scoping rules

2009-08-28 Thread Ethan Furman
kj wrote: Miles Kaufmann mile...@umich.edu 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 print self.x o = C() o.foo() 1 1 o.x = 2

Re: Distutils evil voodoo: install into a package

2009-08-28 Thread Pavel Panchekha
This is what whe world has created namespace-packages for. At least if you can live with the namespace pya being otherwise empty. That seems like a good solution. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Modules/packages by GvR?

2009-08-28 Thread Mark Lawrence
[fix top posting] On Fri, Aug 28, 2009 at 8:58 AM, gb345 gb...@invalid.com wrote: Are there any Python-only modules or packages in the latest releases of Python 2.x or Python 3.x that were largely written by Guido van Rossum? What's the best way to find this out? I know that some modules

Re: Modules/packages by GvR?

2009-08-28 Thread Terry Reedy
Matimus wrote: On Aug 28, 7:58 am, gb345 gb...@invalid.com wrote: Are there any Python-only modules or packages in the latest releases of Python 2.x or Python 3.x that were largely written by Guido van Rossum? What's the best way to find this out? I know that some modules mention the

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread Mark Roseman
With regard to Tkinter documentation, and in particular the newer, more modern aspects thereof (e.g. ttk, styles, etc.) please have a look at the tutorial at http://www.tkdocs.com Would it be useful to link to this from the main Python Tkinter documentation? Mark --

Re: Python on the Web

2009-08-28 Thread John Nagle
Graham Dumpleton wrote: A few additional comments on top of what others have said. On Aug 26, 11:09 am, Phil phil...@gmail.com wrote: As I've read elsewhere, These days, FastCGI is never used directly. Actually, FCGI works quite well. Sitetruth's AdRater

Re: Modules/packages by GvR?

2009-08-28 Thread Benjamin Peterson
Terry Reedy tjreedy at udel.edu writes I am not aware of any recent stdlib modules written by Guido. I suspect most older ones have been updated at least once by someone else. Guido wrote a good deal of the new Python 3 code. However, maintence has now turned over to over Python developers.

Re: Question on the csv library

2009-08-28 Thread vsoler
On Aug 28, 5:43 pm, Steven Rumbalski googleacco...@rumbalski.com wrote: On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com 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:

Re: Object's nesting scope

2009-08-28 Thread Gabriel Genellina
En Thu, 27 Aug 2009 12:43:55 -0300, zaur szp...@gmail.com escribió: On 27 авг, 19:19, Carl Banks pavlovevide...@gmail.com wrote: On Aug 27, 8:01 am, zaur szp...@gmail.com wrote: On 27 авг, 18:34, Carl Banks pavlovevide...@gmail.com wrote: The idea has been discussed in various forms here

Re: Question on the csv library

2009-08-28 Thread Gabriel Genellina
En Fri, 28 Aug 2009 13:35:19 -0300, vsoler vicente.so...@gmail.com escribió: On Aug 28, 5:43 pm, Steven Rumbalski googleacco...@rumbalski.com wrote: On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com wrote: I am trying to read a csv file generated by excel. ['a;qwe;1'] ['b;asd;2']

Re: Question on the csv library

2009-08-28 Thread David Smith
vsoler wrote: Thank you very much for all your comments. After reading them I can conclude that: 1- the CSV format is not standardized; each piece of software uses it differently True, but there are commonalities. See http://en.wikipedia.org/wiki/Comma-separated_values 2- the C in

Re: Raw data extraction question

2009-08-28 Thread Gabriel Genellina
En Wed, 26 Aug 2009 12:18:23 -0300, Maggie la.f...@gmail.com escribió: i have event timing stretch of code i need to alter. here is code below: -- # we start each run with one full silent trial # creating a stub with the duration of a full block # less the discarded acquisitions

Re: Question on the csv library

2009-08-28 Thread Mark Lawrence
vsoler wrote: On Aug 28, 5:43 pm, Steven Rumbalski googleacco...@rumbalski.com wrote: On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com 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:

Re: Need help with Python scoping rules

2009-08-28 Thread kj
In mailman.596.1251474438.2854.python-l...@python.org Ethan Furman et...@stoneleaf.us writes: kj wrote: Miles Kaufmann mile...@umich.edu writes: ...because the suite namespace and the class namespace would get out of sync when different objects were assigned to the class namespace:

Re: Python on the Web

2009-08-28 Thread John Nagle
Bruno Desthuilliers wrote: If you're only writing your framework for learning purposes, you could as well go with Python 3, and implement everything from the ground up (not a trivial task FWIW). Python 3 isn't ready for prime time on web servers. Too many major modules, haven't been

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread r
On Aug 28, 11:12 am, Mark Roseman m...@markroseman.com wrote: Would it be useful to link to this from the main Python Tkinter documentation? Mark Thanks Mark, but i would hate to see more links to TCL code in the python docs. Whats the use of Tkinter if the docs are in TCL. Just learn TCL and

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread Mark Lawrence
r wrote: On Aug 28, 11:12 am, Mark Roseman m...@markroseman.com wrote: Would it be useful to link to this from the main Python Tkinter documentation? Mark Thanks Mark, but i would hate to see more links to TCL code in the python docs. Whats the use of Tkinter if the docs are in TCL. Just

Re: Question on the csv library

2009-08-28 Thread Hrvoje Niksic
David Smith d...@cornell.edu writes: 2- the C in CSV does not mean comma for Microsoft Excel; the ; comes from my regional Spanish settings The C really does stand for comma. I've never seen MS spit out semi-colon separated text on a CSV format. That's because you're running MS Office in a

Query screen resolution?

2009-08-28 Thread AK Eric
Thought this would be easy, maybe I'm missing something :) Trying to query the x,y resolution of my screen. I've seen this available through http://python.net/crew/mhammond/win32/ : from win32api import GetSystemMetrics print width =, GetSystemMetrics (0) print height =,GetSystemMetrics (1)

Re: Query screen resolution?

2009-08-28 Thread Rami Chowdhury
But I was hoping for something built-in, and something non-OS specific. I don't know about built-ins, but I do believe that pygame (which *is* cross-platform) will let you get at that information: http://www.pygame.org/docs/ref/display.html#pygame.display.Info On Fri, 28 Aug 2009

Re: Object's nesting scope

2009-08-28 Thread zaur
On 28 авг, 16:07, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: zaur a écrit : On 26 авг, 17:13, Diez B. Roggisch de...@nospam.web.de wrote: Whom am we to judge? Sure if you propose this, you have some usecases in mind - how about you present these Ok. Here is

Re: Python on the Web

2009-08-28 Thread Bruno Desthuilliers
John Nagle a écrit : Bruno Desthuilliers wrote: If you're only writing your framework for learning purposes, you could as well go with Python 3, and implement everything from the ground up (not a trivial task FWIW). Python 3 isn't ready for prime time on web servers. Too many major

how to edit .wsgi file extebtions with IDLE on windows

2009-08-28 Thread gert
I can't figure out how to enable the .py shell and syntax highlighting for .wsgi file extensions using IDLE for windows ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Select column from a list

2009-08-28 Thread Dave Angel
hoffik wrote: Hello, I'm quite new in Python and I have one question. I have a 2D matrix of values stored in list (3 columns, many rows). I wonder if I can select one column without having to go through the list with 'for' command. For example I have list called 'values'. When I write

Re: How to exclude imports from PyDoc

2009-08-28 Thread Matt Bellis
Hi Diez, Thanks for the heads up. I'll give epydoc a shot. Matt    Anyone know the best way to getPyDocto ignore this (or other) imported module(s)? Don't know aboutpydoc, but epydoc (which generates much nicer docs imho) can be forced to only include certain packages. Diez --

copy construtor question

2009-08-28 Thread xiaosong xia
Hi all,   I am trying to define a class with copy constructor as following:   class test: def __init__(self, s=None):   self=s   x=[1,2]   y=test(x)   print y.__dict__   it gives {}   The above code doesn't work.   Questions are:   1. Can 'self ' be a class attribute? 2. How to make

Re: Query screen resolution?

2009-08-28 Thread Warpcat
On Aug 28, 11:27 am, Rami Chowdhury rami.chowdh...@gmail.com wrote: But I was hoping for something built-in, and something non-OS specific. I don't know about built-ins, but I do believe that pygame (which *is*   cross-platform) will let you get at that information:        

Re: Select column from a list

2009-08-28 Thread Stephen Fairchild
hoffik wrote: Hello, I'm quite new in Python and I have one question. I have a 2D matrix of values stored in list (3 columns, many rows). I wonder if I can select one column without having to go through the list with 'for' command. For example I have list called 'values'. When I write

Colors on IDLE

2009-08-28 Thread vsoler
Everything that I see in IDLE is in black. I have tried to add colors, without success. I've tried: /Options/Configure IDLE/Highlighting/IDLE Classic -- http://mail.python.org/mailman/listinfo/python-list

comparison on list yields surprising result

2009-08-28 Thread Dr. Phillip M. Feldman
In [21]: x Out[21]: [1, 2, 3, 5] In [22]: x6 Out[22]: True Is this a bug? -- View this message in context: http://www.nabble.com/comparison-on-list-yields-surprising-result-tp25195170p25195170.html Sent from the Python - python-list mailing list archive at Nabble.com. --

Re: Colors on IDLE

2009-08-28 Thread vsoler
On Aug 28, 8:58 pm, vsoler vicente.so...@gmail.com wrote: Everything that I see in IDLE is in black. I have tried to add colors, without success. I've tried:  /Options/Configure IDLE/Highlighting/IDLE Classic Couldn't finish writing... sorry --- Everything

Re: Question on the csv library

2009-08-28 Thread John Machin
On Aug 29, 2:35 am, vsoler vicente.so...@gmail.com wrote: 3- Excel does not even put quotes around litteral texts, not even when the text contains a blank Correct. Quoting is necessary only if a text field contains a delimiter (semicolon/comma), a newline, or the quote character. You can read

Re: comparison on list yields surprising result

2009-08-28 Thread John Machin
On Aug 29, 5:00 am, Dr. Phillip M. Feldman pfeld...@verizon.net wrote: In [21]: x Out[21]: [1, 2, 3, 5] In [22]: x6 Out[22]: True Is this a bug? No. http://docs.python.org/reference/expressions.html#notin -- http://mail.python.org/mailman/listinfo/python-list

Re: comparison on list yields surprising result

2009-08-28 Thread Diez B. Roggisch
Dr. Phillip M. Feldman schrieb: In [21]: x Out[21]: [1, 2, 3, 5] In [22]: x6 Out[22]: True Is this a bug? In python2.x, it's the defined behavior - all types are somhow comparable. The comparison is stable (all lists compare larger to all ints), but of course this by no means well-defined.

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread Michiel Overtoom
r wrote: Whats the use of Tkinter if the docs are in TCL. Just learn TCL and skip the Python middleman. But Mark's tutorial at http://www.tkdocs.com/tutorial/index.html allows you to select 'Python' as one of the languages you want to see the example code in. Too bad that the 'ttk'

Re: comparison on list yields surprising result

2009-08-28 Thread Diez B. Roggisch
Dr. Phillip M. Feldman schrieb: In [21]: x Out[21]: [1, 2, 3, 5] In [22]: x6 Out[22]: True Is this a bug? In python2.x, it's the defined behavior - all types are somhow comparable. The comparison is stable (all lists compare larger to all ints), but of course this by no means well-defined.

how to send 100 continues in wsgi application ?

2009-08-28 Thread gert
how do you send 100 continues in a wsgi applications ? when using curl -T file http://localhost/upload.wsgi on the wsgiref.simple_server it get stuck waiting for a 100 continue import os def application(environ, response): query=os.path.join(os.path.dirname(__file__),'teemp')

Re: Overriding iadd for dictionary like objects

2009-08-28 Thread Aahz
In article 21e57363-4e92-41cb-9907-5aef96ad0...@o15g2000yqm.googlegroups.com, RunThePun ubershme...@gmail.com wrote: Anybody have any more ideas? I think python should/could havev a syntax for overriding this behaviour, i mean, obviously the complexity of supporting all operators with the

Re: comparison on list yields surprising result

2009-08-28 Thread Dr. Phillip M. Feldman
It looks as though what I should have done is the following: In [23]: array(x) 6 Out[23]: array([False, False, False, False], dtype=bool) -- View this message in context: http://www.nabble.com/comparison-on-list-yields-surprising-result-tp25195170p25195893.html Sent from the Python -

Re: Colors on IDLE

2009-08-28 Thread Chris Rebert
On Fri, Aug 28, 2009 at 12:00 PM, vsolervicente.so...@gmail.com wrote: On Aug 28, 8:58 pm, vsoler vicente.so...@gmail.com wrote: Everything that I see in IDLE is in black. I have tried to add colors, without success. I've tried:  /Options/Configure IDLE/Highlighting/IDLE Classic Couldn't

  1   2   >