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)

It works for me, save that you need to read the file into a list first

You don't, unless you're using an old python versions (I'd say 2.3 or older). Files are now their own iterators.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to