>>> file=open(‘txt.txt‘,‘a‘) >>> print >> file,‘hello,world‘ >>> file.close()
python输出到文件
原文:http://www.cnblogs.com/wangbin2188/p/6767600.html