Reading corrupted file in python -
i've got file, looks alt text http://img40.imageshack.us/img40/4581/crapq.png there 5 lines shown. running script
with open('hello.txt', 'r') hello: line in hello: print line,
gives
num 1 ctl00$header1$login1$txtusername=ыют;cbШ▌
and that's all. how can read entire file? tia
entire_file = open('hello.txt', 'rb').read() print 'number of \\n: %d, number of bytes %d' % ( entire_file.count('\n'), len(entire_file))
Comments
Post a Comment