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

2013-10-08 Thread Mark Lawrence
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 -8 -*- # file: 'test' """Usage: test [new_dat

Re: [Tutor] Processing CSV files

2013-10-08 Thread Mark Lawrence
On 08/10/2013 21:46, 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 a number v

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

2013-10-08 Thread Alex Kleider
On 2013-10-08 18:02, Steven D'Aprano wrote: Since docopt is not a standard part of Python, nor part of the language itself, you may not find anyone here who knows it well enough to solve the problem. Also keep in mind that docopt is still a fairly young package and may still contain bugs. If we

Re: [Tutor] Tax Brand

2013-10-08 Thread Alan Gauld
On 09/10/13 00:39, Steven D'Aprano wrote: Ah, the good ol' "Make Random Changes In The Hope That The Error Will Go Away" strategy! :-) When I was a young and naive apprentice we had a gnarled old training instructor who called this the "poke n' hope" strategy for fixing faults... (Actually, he

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

2013-10-08 Thread Steven D'Aprano
On Tue, Oct 08, 2013 at 05:50:15PM -0700, 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. Since docopt is not a standard part of Python, nor part of the language itself, you ma

[Tutor] docopt module: defaults appear to be ignored

2013-10-08 Thread Alex Kleider
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 | text_entry FILE | show_data ] [-hdv]

Re: [Tutor] Converting letters to numbers?

2013-10-08 Thread Dave Angel
On 8/10/2013 13:42, Kristen Jakupak wrote: > I have to define a function add(c1, c2), where c1 and c2 are capital > letters; the return value should be the sum (obtained by converting the > letters to numbers, adding mod 26, then converting back to a capital > letter). > > What I have so far is >

Re: [Tutor] Processing CSV files

2013-10-08 Thread Martin A. Brown
Hello there, : We have a box with 16GB RAM so RAM should not be an issue : hopefully. : : The datastore is Cassandra and I'm hoping to use the pycassa : library for interaction. : : I do have an additional question related to Cassandra & Python. : As part of data processing, I need t

Re: [Tutor] Processing CSV files

2013-10-08 Thread Alan Gauld
On 09/10/13 00:26, Leena Gupta wrote: I do have an additional question related to Cassandra & Python. As part of data processing, I need to fetch slices of data from Cassandra and run computations like sum and percentile calculation on it. Sorry, I've never even heard of Cassandra before So

Re: [Tutor] Tax Brand

2013-10-08 Thread Steven D'Aprano
On Tue, Oct 08, 2013 at 10:38:02PM +0200, Thabile Rampa wrote: > taxBAND = None You set taxBAND to None here. This is the only time you assign a value to taxBAND. > if (GrossSalary < 5): > taxdeducted= 0.05*(GrossSalary -costs) > netSalary = GrossSalary - taxdeducted > while Gr

Re: [Tutor] Processing CSV files

2013-10-08 Thread Leena Gupta
Dave, Alan - thanks for replying. We have a box with 16GB RAM so RAM should not be an issue hopefully. The datastore is Cassandra and I'm hoping to use the pycassa library for interaction. I do have an additional question related to Cassandra & Python. As part of data processing, I need to fetch

Re: [Tutor] Tax Brand

2013-10-08 Thread Alan Gauld
On 08/10/13 21:38, Thabile Rampa wrote: deductions. I have seemingly worked everything fine until the part where I am supposed to tell them what tax Band they are in (i.e 1,2,3 or 4). My code is like this: taxBAND = None GrossSalary = None costs = None taxdeducted =None netSalary = None You d

Re: [Tutor] Converting letters to numbers?

2013-10-08 Thread Alan Gauld
On 08/10/13 18:42, Kristen Jakupak wrote: I have to define a function add(c1, c2), where c1 and c2 are capital letters; the return value should be the sum (obtained by converting the letters to numbers, adding mod 26, then converting back to a capital letter). That makes no sense to me. Can you

Re: [Tutor] No module named odbchelper

2013-10-08 Thread Alan Gauld
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 is a Microsoft database access protocol

Re: [Tutor] Help Beginning

2013-10-08 Thread Alan Gauld
On 08/10/13 17:41, Connor Moody wrote: Im having trouble finding a website that simply teaches it. There is a page at python.org for complete beginners. One thing to watch is which version of Python you use. Some tutorials are written for Python v2 others for v3, and although similar they are

[Tutor] Tax Brand

2013-10-08 Thread Thabile Rampa
Hello, So my task is to get information from a user about their salary and then find their net salary and tax deductions. I have seemingly worked everything fine until the part where I am supposed to tell them what tax Band they are in (i.e 1,2,3 or 4). My code is like this: taxBAND = None Gros

[Tutor] Converting letters to numbers?

2013-10-08 Thread Kristen Jakupak
I have to define a function add(c1, c2), where c1 and c2 are capital letters; the return value should be the sum (obtained by converting the letters to numbers, adding mod 26, then converting back to a capital letter). What I have so far is def add(c1, c2): ans = '' for i in c1 + c2:

[Tutor] No module named odbchelper

2013-10-08 Thread Rabah Abdallah
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 here is my code on text wrangler import sys sys.path.append('/Users/rabahabdallah/Desk

[Tutor] Help Beginning

2013-10-08 Thread Connor Moody
Hello, I'm starting off programing with python and i like it (so far). Im having trouble finding a website that simply teaches it. I have never programmed before and i thought this would be a great place to start. What websites should I use to start off? Sent from my iPad __

Re: [Tutor] Processing CSV files

2013-10-08 Thread Dave Angel
On 8/10/2013 16:46, 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] Processing CSV files

2013-10-08 Thread Alan Gauld
On 08/10/13 21:46, Leena Gupta wrote: 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(+). Assuming you have a modern multi-core PC with >2G RAM then those sizes should not be a problem. If you have an older PC t

[Tutor] Processing CSV files

2013-10-08 Thread Leena Gupta
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 a number value by grouping on certain attributes and