#指定的盘存在 a+可读写文件 如果没有创建文件 存在就在文件后面追加
fp=open('C:/Users/Administrator/Desktop/zzz12.txt','a+')
#使用file 才能在文本文件中显示
print('hello',file=fp)
print('hello','hushu',file=fp) #换行用逗号
fp.close()
实现效果

#指定的盘存在 a+可读写文件 如果没有创建文件 存在就在文件后面追加
fp=open('C:/Users/Administrator/Desktop/zzz12.txt','a+')
#使用file 才能在文本文件中显示
print('hello',file=fp)
print('hello','hushu',file=fp) #换行用逗号
fp.close()
实现效果