Discuss / Python / 交作业

交作业

Topic source

程程wcl

#1 Created at ... [Delete] [Delete and Lock User]

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

  • 1

Reply