Re: [Tutor] docopt module: defaults appear to be ignored

2013-10-09 Thread Alex Kleider
On 2013-10-08 22:35, Mark Lawrence wrote: On 09/10/2013 01:50, Alex Kleider wrote: A recent post recommended the docopt module so I've incorporated it into the code I'm using to learn SQLite. It's not behaving as I expected. Here's a snippet of code: #!/usr/bin/env python # -*- coding : utf

Re: [Tutor] Processing CSV files

2013-10-09 Thread Sivaram Neelakantan
On Wed, Oct 09 2013,Leena Gupta wrote: > Hello, > > Looking for some inputs on Python's csv processing feature. > > I need to process a large csv file every 5-10 minutes. The file could > contain 3mill to 10 mill rows and size could be 6MB to 10MB(+). As part of > the processing, I need to sum up

Re: [Tutor] Writing Function Definitions

2013-10-09 Thread Dave Angel
On 9/10/2013 07:35, Chris Down wrote: > On 2013-10-09 11:28, Dave Angel wrote: >> Alan's suggestions pretty much cover mine. Make your code readable, >> rather than clever while you're learning. > > s/while you're learning// > But by the time you learn enough, you realize that when you stop lear

Re: [Tutor] Writing Function Definitions

2013-10-09 Thread Chris Down
On 2013-10-09 11:28, Dave Angel wrote: > Alan's suggestions pretty much cover mine. Make your code readable, > rather than clever while you're learning. s/while you're learning// pgpjKcnwi1MeE.pgp Description: PGP signature ___ Tutor maillist - Tuto

Re: [Tutor] Writing Function Definitions

2013-10-09 Thread Dave Angel
On 8/10/2013 18:50, Connor Hood wrote: > Hi, I am taking a class in order to learn Python. Welcome to Python, and to Python-tutor. > One of the exercises I need to do is write function definitions. I > cannot figure out how to do one of them. To show you an example here is a > similar problem:

Re: [Tutor] Writing Function Definitions

2013-10-09 Thread Alan Gauld
On 08/10/13 23:50, Connor Hood wrote: # isPrime(m): I -> Bool # If m is an integer, then isPrime(m) if and only if m is prime. def isPrime(m): return False if m <= 1 else isPrimeItr(1,0,m) # isPrimeItr(i,a,m): I x I x I -> Bool def isPrimeItr(i,a,m): return False if a> 2 else True if

Re: [Tutor] Writing Function Definitions

2013-10-09 Thread Chris Down
Hi Connor, On 2013-10-08 17:50, Connor Hood wrote: > Hi, I am taking a class in order to learn Python. One of the exercises I need > to do is write function definitions. I cannot figure out how to do one of > them. To show you an example here is a similar problem: > If m is an integer, then isP

[Tutor] Writing Function Definitions

2013-10-09 Thread Connor Hood
Hi, I am taking a class in order to learn Python. One of the exercises I need to do is write function definitions. I cannot figure out how to do one of them. To show you an example here is a similar problem: If m is an integer, then isPrime(m) iff m is prime.The code: # Prompts the user for an in

Re: [Tutor] docopt module: defaults appear to be ignored

2013-10-09 Thread Peter Otten
Alex Kleider wrote: > > A recent post recommended the docopt module so I've incorporated it into > the code I'm using to learn SQLite. It's not behaving as I expected. > Here's a snippet of code: > > > #!/usr/bin/env python > # -*- coding : utf -8 -*- > # file: 'test' > """Usage: test [new_data

Re: [Tutor] No module named odbchelper

2013-10-09 Thread Andreas Perstinger
On 09.10.2013 00:37, Alan Gauld wrote: On 08/10/13 19:33, Rabah Abdallah wrote: Hi I am using dive in python book to to learn python programing languege on mac in one of the examples is odbchelper imported but when i start debugging I recieved ImportError: No module named odbchelper ODBC