python - Strange character in file breaks for loop silently -
i'm parsing file python , loop breaks on character in notepad++ looks this
©sub0
my loop simple
for line in open('myfile.dat').readlines(): print line print x x+=1
there no error, py file quits.
what should make skip character?
is file binary file? if so, try doing open('myfile.dat', 'rb')
open binary. if open text, end-of-file character can cause stop reading prematurely.
Comments
Post a Comment