摘要: 如果使用Python2.5或更早版本,请打开文件,然后在重定向中使用file对象: log = open("c:\\goat.txt", "w") print >>log, "test" 如果使用Python2.6或2.7,可以使用print作为函数: from __future__ import 阅读全文
posted @ 2020-04-12 18:06 邱明成 阅读(1930) 评论(0) 推荐(0) 编辑