Hi,

After creating a list of words ('wordlist'), I can run the following
code in the interactive window of PythonWin in about ten seconds. If I
run the script containing the code, the script seems to hang on the
loop. I'd be grateful for help as to why; I often seem to have something
that works in the interpreter, but not when I run the script.

Thanks in advance,
Nick


N = [2,3,4,5]
ngramlist = [wordlist]
for n in N:
    ngrams = [' '.join(wordlist[i:i+n]) for i in
range(len(wordlist)-n+1)]
    "Finished the %d-gram list." % n
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to