Re: Where is the syntax for the dict() constructor ?! (OT)

2007-07-10 Thread Hendrik van Rooyen
Steve Holden [EMAIL PROTECTED] wrote: Sorry - dreadful joke. Since teeth chew, I wondered whether esteeth might eschew. [Graon ...] *grin* *Wonders if he can extend this troll to get Steve to explain what teeth are.* ; - ) - Hendrik --

Re: Where is the syntax for the dict() constructor ?! (OT)

2007-07-10 Thread Steve Holden
Hendrik van Rooyen wrote: Steve Holden [EMAIL PROTECTED] wrote: Sorry - dreadful joke. Since teeth chew, I wondered whether esteeth might eschew. [Graon ...] *grin* *Wonders if he can extend this troll to get Steve to explain what teeth are.* ; - ) - Hendrik Bite me :-)

Re: Where is the syntax for the dict() constructor ?! (OT)

2007-07-09 Thread Hendrik van Rooyen
Steve Holden [EMAIL PROTECTED] wrote: Would we do that with esteeth? Ok Steve you've got me - my dictionary goes from estate to esteem to ester... The US spelling of esthete may have a bearing... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is the syntax for the dict() constructor ?! (OT)

2007-07-09 Thread Steve Holden
Hendrik van Rooyen wrote: Steve Holden [EMAIL PROTECTED] wrote: Would we do that with esteeth? Ok Steve you've got me - my dictionary goes from estate to esteem to ester... The US spelling of esthete may have a bearing... - Hendrik Sorry - dreadful joke. Since teeth chew, I

Re: Where is the syntax for the dict() constructor ?!

2007-07-08 Thread Hendrik van Rooyen
John Machin [EMAIL PROTECTED] wrote: 8 nice explanation of quoting problems - (2) A field containing an odd number of characters (or more generally, not meeting whatever quoting convention might be expected in the underlying data) should be treated with suspicion.

Re: Where is the syntax for the dict() constructor ?!

2007-07-08 Thread Steve Holden
Hendrik van Rooyen wrote: John Machin [EMAIL PROTECTED] wrote: 8 nice explanation of quoting problems - (2) A field containing an odd number of characters (or more generally, not meeting whatever quoting convention might be expected in the underlying data) should

Re: Where is the syntax for the dict() constructor ?!

2007-07-07 Thread Hendrik van Rooyen
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 06 Jul 2007 08:34:55 +0200, Hendrik van Rooyen wrote: You can even do it more simply - by writing a GetField() that scans for either the delimiter or end of line or end of file, and returns the field found, along with the

Re: Where is the syntax for the dict() constructor ?!

2007-07-07 Thread Marc 'BlackJack' Rintsch
On Sat, 07 Jul 2007 08:32:52 +0200, Hendrik van Rooyen wrote: erik,viking,ham, spam and eggs,He said Ni!,line one line two That's 5 elements: 1: eric 2: viking 3: ham, spam and eggs 4: He said Ni! 5: line one line two Also true - What can I say - I can only wriggle and

Re: Where is the syntax for the dict() constructor ?!

2007-07-07 Thread John Machin
On Jul 7, 4:58 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Sat, 07 Jul 2007 08:32:52 +0200, Hendrik van Rooyen wrote: erik,viking,ham, spam and eggs,He said Ni!,line one line two That's 5 elements: 1: eric 2: viking 3: ham, spam and eggs 4: He said Ni! 5: line one

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Hendrik van Rooyen
John Machin sj,,,[EMAIL PROTECTED] wrote: I don't know what you mean by requires more than one character of lookahead -- any non-Mickey-Mouse implementation of a csv reader will use a finite state machine with about half-a-dozen states, and data structures no more complicated than (1)

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Marc 'BlackJack' Rintsch
On Fri, 06 Jul 2007 08:34:55 +0200, Hendrik van Rooyen wrote: John Machin sj,,,[EMAIL PROTECTED] wrote: I don't know what you mean by requires more than one character of lookahead -- any non-Mickey-Mouse implementation of a csv reader will use a finite state machine with about

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Neil Cerutti
On 2007-07-05, John Machin [EMAIL PROTECTED] wrote: On Jul 6, 5:31 am, Neil Cerutti [EMAIL PROTECTED] wrote: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this unecessarily hard to parse (it requires more than one

Re: Where is the syntax for the dict() constructor ?!

2007-07-06 Thread Neil Cerutti
On 2007-07-06, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-07-05, John Machin [EMAIL PROTECTED] wrote: On Jul 6, 5:31 am, Neil Cerutti [EMAIL PROTECTED] wrote: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Chris Mellon
On 7/5/07, Captain Poutine [EMAIL PROTECTED] wrote: I'm simply trying to read a CSV into a dictionary. (if it matters, it's ZIP codes and time zones, i.e., 35983,CT 39161,CT 47240,EST Apparently the way to do this is: import csv dictZipZones = {} reader = csv.reader(open(some.csv,

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Captain Poutine [EMAIL PROTECTED] wrote: I'm simply trying to read a CSV into a dictionary. (if it matters, it's ZIP codes and time zones, i.e., 35983,CT 39161,CT 47240,EST Apparently the way to do this is: import csv dictZipZones = {} reader =

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Peter Otten
Neil Cerutti wrote: On 2007-07-05, Captain Poutine [EMAIL PROTECTED] wrote: I'm simply trying to read a CSV into a dictionary. (if it matters, it's ZIP codes and time zones, i.e., 35983,CT 39161,CT 47240,EST Apparently the way to do this is: import csv dictZipZones = {} reader =

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Captain Poutine
Neil Cerutti wrote: On 2007-07-05, Captain Poutine [EMAIL PROTECTED] wrote: I'm simply trying to read a CSV into a dictionary. (if it matters, it's ZIP codes and time zones, i.e., 35983,CT 39161,CT 47240,EST Apparently the way to do this is: import csv dictZipZones = {} reader =

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Captain Poutine
Peter Otten wrote: Neil Cerutti wrote: On 2007-07-05, Captain Poutine [EMAIL PROTECTED] wrote: I'm simply trying to read a CSV into a dictionary. (if it matters, it's ZIP codes and time zones, i.e., 35983,CT 39161,CT 47240,EST Apparently the way to do this is: import csv

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Thomas Jollans
On Thursday 05 July 2007, Captain Poutine wrote: Peter Otten wrote: Neil Cerutti wrote: On 2007-07-05, Captain Poutine [EMAIL PROTECTED] wrote: I'm simply trying to read a CSV into a dictionary. (if it matters, it's ZIP codes and time zones, i.e., 35983,CT 39161,CT 47240,EST

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Captain Poutine [EMAIL PROTECTED] wrote: Reader objects (DictReader instances and objects returned by the reader() function) have the following public methods: Lucky for you and me, Peter Otten corrected my mistaken advice. next( ) Return the next row of the

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Nis Jørgensen
Neil Cerutti skrev: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this unecessarily hard to parse (it requires more than one character of lookahead for no reason except bad design) data format. I knew there had to

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Wildemar Wildenburger
Nis Jørgensen wrote: Neil Cerutti skrev: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this unecessarily hard to parse (it requires more than one character of lookahead for no reason except bad design) data

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread John Machin
On Jul 6, 5:31 am, Neil Cerutti [EMAIL PROTECTED] wrote: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this unecessarily hard to parse (it requires more than one character of lookahead for no reason except bad

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Alex Martelli
Neil Cerutti [EMAIL PROTECTED] wrote: Besides, a string is an excellent epresentation for a zip code, since arithmetic upon them is unthinkable. Absolutely! Excel, unless you remedied that later with a column operation, would turn some East Coast zipcodes into 3- and 4-digit numbers (dropping

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Nis Jørgensen
Wildemar Wildenburger skrev: Nis Jørgensen wrote: Neil Cerutti skrev: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this unecessarily hard to parse (it requires more than one character of lookahead for no

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Dan Bishop
On Jul 5, 10:19 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: Neil Cerutti [EMAIL PROTECTED] wrote: Besides, a string is an excellent epresentation for a zip code, since arithmetic upon them is unthinkable. Absolutely! Excel, unless you remedied that later with a column operation, would