6-01 2,735 views
"python写文件"
try:
with open('123.txt','r') as data:
print('It is ..',file=data)
except IOError as err:
print('File error:'+str(err))
"python读文件"
try:
with open('123.txt','r') as data:
for line in data:
print(line)
except IOError as err:
print('File error:'+str(err))