#将数据输出文件中,所指定盘符存在
fp=open('D:/text.txt','a+') #a+表示以读写·方式打开文件,如文件不存在,则新建。
print(“hello,world',file=fp)#使用file=文件名
fp.close