Pyhon:按行输出文件内容
最后更新于:2022-04-01 19:39:25
~~~
#! /usr/bin/python3
try:
filename = input('Please input filename:')
fobj = open(filename, 'r')
for eachLine in fobj:
print(eachLine)
fobj.close()
except IOError as err:
print('file open error: {0}'.format(err))
~~~
';