Re: Computing win/loss records in Python

2012-08-26 Thread Hans Mulder
On 26/08/12 04:42:59, Steven W. Orr wrote: > On 8/25/2012 10:20 PM, Christopher McComas wrote: >> Greetings, >> >> I have code that I run via Django that grabs the results from various >> sports from formatted text files. The script iterates over every line >> in the formatted text files, finds the

Re: Computing win/loss records in Python

2012-08-25 Thread Ben Finney
Christopher McComas writes: > I have code that I run via Django that grabs the results from various > sports from formatted text files. The script iterates over every line > in the formatted text files, finds the team in the Postgres database > updates their w/l record depending on the outcome on

Re: Computing win/loss records in Python

2012-08-25 Thread Steven D'Aprano
On Sat, 25 Aug 2012 22:20:05 -0400, Christopher McComas wrote: > Marshall,24,Ohio State,48, > Kentucky,14,Indiana,10, > Marshall,10,Indiana,7, > Ohio State,28,Kentucky,10 > > That's just a quick example, I can handle seperating the data in the > lines, figuring it all out, I just am unsure of how

Re: Computing win/loss records in Python

2012-08-25 Thread Steven D'Aprano
On Sat, 25 Aug 2012 22:42:59 -0400, Steven W. Orr wrote: > win_count = defaultdict(int) > loss_count = defaultdict(int) When I try that, I get "NameError: name 'defaultdict' is not defined." I think it is rather unfair on beginners to show them code that almost, but not quite, works, and expect

Re: Computing win/loss records in Python

2012-08-25 Thread Steven W. Orr
On 8/25/2012 10:20 PM, Christopher McComas wrote: Greetings, I have code that I run via Django that grabs the results from various sports from formatted text files. The script iterates over every line in the formatted text files, finds the team in the Postgres database updates their w/l record

Re: Computing win/loss records in Python

2012-08-25 Thread Rodrick Brown
On Aug 25, 2012, at 10:22 PM, Christopher McComas wrote: > Greetings, > > I have code that I run via Django that grabs the results from various sports > from formatted text files. The script iterates over every line in the > formatted text files, finds the team in the Postgres database updates

Computing win/loss records in Python

2012-08-25 Thread Christopher McComas
Greetings, I have code that I run via Django that grabs the results from various sports from formatted text files. The script iterates over every line in the formatted text files, finds the team in the Postgres database updates their w/l record depending on the outcome on that line, saves the t