with open("e:\\1.txt","rb") as f:
while True:
if len(f.readline())==0:
break
print(f.readline())
代码片
#==========1.txt
#include <stdio.h>
int main()
{
return 0;
}
1234567890-=
qweryuop[]
!@#$%^&*()
#打印结果
b’int main()\r\n’
b’\treturn 0;\r\n’
b’1234567890-=\r\n’
b’!@#$%^&*()’