with open('test.txt', 'r') as fr: # 在当前目录下创建test1.txt文件
contents = fr.read()
with open('test.txt', 'w') as wf:
new = int(contents)
wf.write(f'{new+1}')
print(f"现在是{new}")
01-28
1843
with open('test.txt', 'r') as fr: # 在当前目录下创建test1.txt文件
contents = fr.read()
with open('test.txt', 'w') as wf:
new = int(contents)
wf.write(f'{new+1}')
print(f"现在是{new}")