Newbie: What's wrong with this 6-line script?

Larry Bates lbates at swamisoft.com
Thu Jun 3 19:44:07 EDT 2004


A known problem in the interpreter.  If
output lines get too long the "disappear".
If you scroll right with mouse by clicking
the right arrow, you will see the line
"magically" appear.

Larry Bates
Syscon, Inc.

"Brent W. Hughes" <brent.hughes at comcast.net> wrote in message
news:8COvc.4324$%F2.43 at attbi_s04...
> If the file Test1.txt contains 257 words, the following script works as
> you'd expect.  But if Test1.txt contains 258 words, the last line of the
> script prints a blank line instead of the words.
> ==========================
> import sys
> f = file("Test1.txt")
> s = f.read()
> f.close()
> t = s.split()
> print t
> ===========================
> BTW, if I run these same lines in the Python interactive shell, it will
work
> fine even with 20000 words in Test1.txt.
>
> Is there something simple I don't understand?
>
> Brent
>
>





More information about the Python-list mailing list