fpath = r'C:\Work\test.txt'
with open(fpath, 'a') as f:
f.write(' shake it off')
with open(fpath,'r') as f:
print(f.read())
输出结果:
hello,world shake it off
Sign in to make a reply
程程wcl
fpath = r'C:\Work\test.txt'
with open(fpath, 'a') as f:
f.write(' shake it off')
with open(fpath,'r') as f:
print(f.read())
输出结果: