Re: problem with dictionaries

2008-04-23 Thread Terry Reedy
"Simon Strobl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Any hints? For future reference, I would consider using sample data in the file itself for debugging -- to separate an algorithm problem from a file problem: | | | #!/u

Re: problem with dictionaries

2008-04-23 Thread Simon Strobl
> You musts have missed the memo. The rules of the universe > changed at 0834 UST yesterday, and all functioning Python programs > stopped working. As always, the rules of the universe have not changed. (Or, at least, I do hope so.) It seems that the cause of my problem was my switching too fast

Re: problem with dictionaries

2008-04-23 Thread kdwyer
On Apr 23, 1:22 pm, Bruno Desthuilliers wrote: > kdwyer a écrit :> On Apr 23, 12:16 pm, Simon Strobl <[EMAIL PROTECTED]> wrote: > (snip) > >> #!/usr/bin/python > > >> import sys > > >> frqlist = open('my_frqlist.txt', 'r') > (snip) > >> frq = {} > > >> for line in frqlist: > >> line = line.rst

Re: problem with dictionaries

2008-04-23 Thread Bruno Desthuilliers
kdwyer a écrit : On Apr 23, 12:16 pm, Simon Strobl <[EMAIL PROTECTED]> wrote: (snip) #!/usr/bin/python import sys frqlist = open('my_frqlist.txt', 'r') (snip) frq = {} for line in frqlist: line = line.rstrip() frequency, word = line.split('|') frq[word] = int(frequency) (snip

Re: problem with dictionaries

2008-04-23 Thread Steve Holden
Simon Strobl wrote: Hello, the idea of the following program is to parse a frequency list of the form FREQUENCY|WORD, to store the frequency of a word in a dictionary (and to do some things with this information later). I have done this many many times. Suddenly, it does not work any more: The

Re: problem with dictionaries

2008-04-23 Thread kdwyer
On Apr 23, 12:16 pm, Simon Strobl <[EMAIL PROTECTED]> wrote: > Hello, > > the idea of the following program is to parse a frequency list of the > form FREQUENCY|WORD, to store the frequency of a word in a dictionary > (and to do some things with this information later). > > I have done this many ma

Re: problem with dictionaries

2008-04-23 Thread Chris
On Apr 23, 1:16 pm, Simon Strobl <[EMAIL PROTECTED]> wrote: > Hello, > > the idea of the following program is to parse a frequency list of the > form FREQUENCY|WORD, to store the frequency of a word in a dictionary > (and to do some things with this information later). > > I have done this many man

Re: problem with dictionaries

2008-04-23 Thread Peter Otten
Simon Strobl wrote: > the idea of the following program is to parse a frequency list of the > form FREQUENCY|WORD, to store the frequency of a word in a dictionary > (and to do some things with this information later). > > I have done this many many times. Suddenly, it does not work any more: > T

problem with dictionaries

2008-04-23 Thread Simon Strobl
Hello, the idea of the following program is to parse a frequency list of the form FREQUENCY|WORD, to store the frequency of a word in a dictionary (and to do some things with this information later). I have done this many many times. Suddenly, it does not work any more: The value frq[key] is diff