我有一个文件,看起来像这个alt文本http://img40.imageshack.us/img40/4581/crapq.png 现在有5行显示.但运行此脚本
with open('hello.txt', 'r') as hello:
for line in hello:
print line,
Run Code Online (Sandbox Code Playgroud)
给
num 1
ctl00$header1$Login1$txtUserName=???;CB??
Run Code Online (Sandbox Code Playgroud)
就这样.我怎么能读完整个文件?TIA
entire_file = open('hello.txt', 'rb').read()
print 'number of \\n: %d, number of bytes %d' % (
entire_file.count('\n'), len(entire_file))
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1351 次 |
| 最近记录: |