Re: [Tutor] python at midnight

2010-11-17 Thread ingo
On Sun, Nov 14, 2010 at 11:48 PM, Steven D'Aprano wrote: >> How to get this functionality added to Python? > > Make a feature request on the Python bug tracker: > > http://bugs.python.org/ done: http://bugs.python.org/issue10427 i. ___ Tutor maillist

[Tutor] Accessing columns of a CSV file

2010-11-17 Thread Hanlie Pretorius
Hi, I'm reading a CSV file and I want to test the contents of its second column before I write it to an output file: >>> import csv >>> time_list=['00:00', '03:00', >>> '06:00','09:00','12:00','15:00','18:00','21:00'] >>> readfile='C8R004_flow.csv' >>> in_text=open(readfile,'rb') >>> cr=csv.read

Re: [Tutor] Accessing columns of a CSV file

2010-11-17 Thread Adam Bark
On 17/11/10 13:59, Hanlie Pretorius wrote: Hi, I'm reading a CSV file and I want to test the contents of its second column before I write it to an output file: import csv time_list=['00:00', '03:00', '06:00','09:00','12:00','15:00','18:00','21:00'] readfile='C8R004_flow.csv' in_text=open(r

Re: [Tutor] Accessing columns of a CSV file

2010-11-17 Thread Erik H.
Also notice that in time_list you use %H:%M format, while in your rows the format is %H:%M:%S. Simple string comparison won't work, unless you add those seconds to your time_list. Regards, Erik On Wed, Nov 17, 2010 at 2:59 PM, Hanlie Pretorius wrote: > Hi, > > I'm reading a CSV file and I want

Re: [Tutor] Need help with script for finding pairs of amicable numbers

2010-11-17 Thread Richard D. Moores
I got no response to my post that began this thread 8 days ago. I followed that with a new thread, "List comprehension question" that continued for 60+ posts, and from which I learned a lot -- about optimizing a function (and the importance of timing the various candidates for improvement). The fun

[Tutor] Assistance with Psuedocode

2010-11-17 Thread Joe Ohmer
Hello, The following code works well but I don't understand why the mysteryEffect code block changes the picture. Doesn’t 64*(r/64) just equal r? (Same with g and b.) So this function should not change the picture at all. But it does! If anyone can explain how and why this actually changes the

Re: [Tutor] Assistance with Psuedocode

2010-11-17 Thread Alan Gauld
"Joe Ohmer" wrote The following code works well but I don't understand why the mysteryEffect code block changes the picture. Doesn’t 64*(r/64) just equal r? That dependfs on which version of Python you use. In earlier versions '/' meant integer division so (1/64) * 64=> 0 * 64 (120/64)

Re: [Tutor] Assistance with Psuedocode

2010-11-17 Thread Adam Bark
On 18/11/10 00:49, Alan Gauld wrote: "Joe Ohmer" wrote The following code works well but I don't understand why the mysteryEffect code block changes the picture. Doesn’t 64*(r/64) just equal r? That dependfs on which version of Python you use. In earlier versions '/' meant integer division

Re: [Tutor] Assistance with Psuedocode

2010-11-17 Thread Dave Angel
On 2:59 PM, Joe Ohmer wrote: Hello, The following code works well but I don't understand why the mysteryEffect code block changes the picture. Doesn’t 64*(r/64) just equal r? (Same with g and b.) So this function should not change the picture at all. But it does! If anyone can explain how and

[Tutor] Python Books...*

2010-11-17 Thread Srinidhi Rao
Hello Pythoners', I am a beginner here want to explore python, thinking this is the best place to start with, I request you experts to help me become one... To Start with which is the best book to get a hang of what python is and also provide some distinction between the Python 2.6 and 3.x... If