Reading long lines doesn't work in Python

S

Scott Simpson

I have a loop

for line in f:
...

and if the line is over about 10,000 characters it lops it off. How do I
get around this?
 
J

jay graves

Scott said:
I have a loop

for line in f:
...

and if the line is over about 10,000 characters it lops it off. How do I
get around this?

Hmmm. Works for me on Windows.

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information..... print len(l)
....
11001
11001
11001
Could the file have embedded nulls? Are you on Windows? If the file
is small enough, open it in binary mode and do a split on '\n to verify
your data.

....
jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top