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 > 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 not get jumbled u

Re: Select column from a list

2009-08-28 Thread Xavier Ho
On Fri, Aug 28, 2009 at 5:45 PM, 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. As far as I know tho

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread eb303
On Aug 27, 11:22 pm, r 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 subpage for

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 'values[0

Re: Question on the "csv" library

2009-08-28 Thread Mark Lawrence
John Machin wrote: 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: 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 al

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 tha

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 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 Nuke-user mailing list

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() mail_server.sta

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 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, when they discuss scopes, are off to a bad

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_c

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, s/class/function/ The function objects (defined in a class statement body...) are created before the class object itself. thus "self" is not defined at that point since the class is still

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 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 “reply to author”, and

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 > 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. Would you be so kind and share with us for such

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 lists

Re: Select column from a list

2009-08-28 Thread Anthra Norell
Vlastimil Brom wrote: 2009/8/28 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. ... I guess, it won't be p

Re: Select column from a list

2009-08-28 Thread Vlastimil Brom
2009/8/28 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. > ... I guess, it won't be possible without an ex

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

Re: Question on the "csv" library

2009-08-28 Thread Andreas Waldenburger
On Fri, 28 Aug 2009 09:03:49 +0100 Mark Lawrence 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 self.

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 al

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

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" 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 address = Addres

Re: Sending email

2009-08-28 Thread 7stud
On Aug 28, 2:37 am, Fencer 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() > > mail_server.connect('smtp.gm

Re: Select column from a list

2009-08-28 Thread Piet van Oostrum
> hoffik (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 'v

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 sessi

Re: Read a content file from a P7M

2009-08-28 Thread Luca
On Fri, Mar 20, 2009 at 4:12 PM, Emanuele Rocca 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 of

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

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

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

Re: why python got less developers ?

2009-08-28 Thread sturlamolden
On 28 Aug, 02:34, Deep_Feelings 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 wrote: > > 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

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 y

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 wrote: > On 28 Aug, 02:34, Deep_Feelings 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 sense!! :-) -- http://mail.pytho

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

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

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 fro

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 Knop

Re: Transforming a str to an operator

2009-08-28 Thread Gabriel Genellina
En Fri, 28 Aug 2009 01:50:37 -0300, Xavier Ho escribió: On Fri, Aug 28, 2009 at 2:35 PM, Ben Finney wrote: op_funcs = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.div, } op_prompt = "Select an operator ({}):".format(','.j

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 th

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 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. Would you be so kind and share wi

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, A

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 a

Re: Modules/packages by GvR?

2009-08-28 Thread Matimus
On Aug 28, 7:58 am, gb345 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 source code, but th

Re: why python got less developers ?

2009-08-28 Thread jfabiani
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. :) I'm inclined to agreed. But in r

Re: Question on the "csv" library

2009-08-28 Thread Steven Rumbalski
On Aug 27, 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 spamReader > > <_

Re: Need help with Python scoping rules

2009-08-28 Thread Ethan Furman
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 print self.x o = C() o.foo() 1 1 o.x = 2 o.foo() 1 2 B

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

Re: Modules/packages by GvR?

2009-08-28 Thread Terry Reedy
Matimus wrote: On Aug 28, 7:58 am, gb345 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 source co

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

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 wrote: As I've read elsewhere, "These days, FastCGI is never used directly. Actually, FCGI works quite well. Sitetruth's AdRater (http://www.sitetruth.com/downloads/adrater.html)

Re: Modules/packages by GvR?

2009-08-28 Thread Benjamin Peterson
Terry Reedy 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. For ex

Re: Question on the "csv" library

2009-08-28 Thread vsoler
On Aug 28, 5:43 pm, Steven Rumbalski wrote: > On Aug 27, 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 = c

Re: Object's nesting scope

2009-08-28 Thread Gabriel Genellina
En Thu, 27 Aug 2009 12:43:55 -0300, zaur escribió: On 27 авг, 19:19, Carl Banks wrote: On Aug 27, 8:01 am, zaur wrote: > On 27 авг, 18:34, Carl Banks wrote: > > The idea has been > > discussed in various forms here quite a bit over the years.  I doubt > > there's any chance it'll be accepted

Re: Question on the "csv" library

2009-08-28 Thread Gabriel Genellina
En Fri, 28 Aug 2009 13:35:19 -0300, vsoler escribió: On Aug 28, 5:43 pm, Steven Rumbalski wrote: On Aug 27, 3:06 pm, vsoler wrote: > I am trying to read a csv file generated by excel. > ['a;qwe;1'] > ['b;asd;2'] > ['c;zxc;3'] Thank you very much for all your comments. After reading th

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

Re: Raw data extraction question

2009-08-28 Thread Gabriel Genellina
En Wed, 26 Aug 2009 12:18:23 -0300, Maggie 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 stub = block_dur -

Re: Question on the "csv" library

2009-08-28 Thread Mark Lawrence
vsoler wrote: On Aug 28, 5:43 pm, Steven Rumbalski wrote: On Aug 27, 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.

Re: Need help with Python scoping rules

2009-08-28 Thread kj
In Ethan Furman writes: >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 >>> print

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 ported

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread r
On Aug 28, 11:12 am, Mark Roseman 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 skip the Python

Re: An assessment of Tkinter and IDLE

2009-08-28 Thread Mark Lawrence
r wrote: On Aug 28, 11:12 am, Mark Roseman 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 skip the P

Re: Question on the "csv" library

2009-08-28 Thread Hrvoje Niksic
David Smith 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 U

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

Re: Object's nesting scope

2009-08-28 Thread zaur
On 28 авг, 16:07, Bruno Desthuilliers wrote: > zaur a écrit : > > > > > On 26 авг, 17:13, "Diez B. Roggisch" 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

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 ma

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 'values[0

Re: How to exclude "import"s 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. > > Di

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" 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: >        http://www.pygame.org/docs/ref/

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

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]: x>6 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. -- http://mail.python.

Re: Colors on IDLE

2009-08-28 Thread vsoler
On Aug 28, 8:58 pm, vsoler 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 that I see in IDLE

Re: Question on the "csv" library

2009-08-28 Thread John Machin
On Aug 29, 2:35 am, vsoler 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 Excel CSV output usin

Re: comparison on list yields surprising result

2009-08-28 Thread John Machin
On Aug 29, 5:00 am, "Dr. Phillip M. Feldman" wrote: > In [21]: x > Out[21]: [1, 2, 3, 5] > > In [22]: x>6 > 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]: x>6 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' widget

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]: x>6 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') ran

Re: Overriding iadd for dictionary like objects

2009-08-28 Thread Aahz
In article <21e57363-4e92-41cb-9907-5aef96ad0...@o15g2000yqm.googlegroups.com>, RunThePun 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 getitem syntax could i

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 - python-l

Re: Colors on IDLE

2009-08-28 Thread Chris Rebert
On Fri, Aug 28, 2009 at 12:00 PM, vsoler wrote: > On Aug 28, 8:58 pm, vsoler 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 > ---

Re: Overriding iadd for dictionary like objects

2009-08-28 Thread Carl Banks
On Aug 26, 11:49 pm, RunThePun 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 getitem syntax could introduce > alot of clutter. But maybe there's an elegant so

Re: Object's nesting scope

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

Re: why python got less developers ?

2009-08-28 Thread Charles Yeomans
On Aug 28, 2009, at 1:03 AM, 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 fas

cgi and POST

2009-08-28 Thread Ken Seehart
I can't seem to find an answer to this simple question on the web, and the documentation doesn't seem to indicate how to do this... On the client I have: urllib.urlopen(uri, data) This does a POST, but it's not obvious to me how this maps onto the various cgi examples which assume that

Re: Colors on IDLE

2009-08-28 Thread vsoler
On Aug 28, 9:55 pm, Chris Rebert wrote: > On Fri, Aug 28, 2009 at 12:00 PM, vsoler wrote: > > On Aug 28, 8:58 pm, vsoler 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

  1   2   >