摘要: stdout:标准输出stderr:标准错误print 相当于 sys.stdout.write() + 换行一个将数据流写入文件的程序,文件名为:main.pydef main(out=sys.stdout): config = 'Hello' out.write(config)if __name__ == '__main__': main()在命令行下运行main.py > abcdfg.txt就会将Hello字符串写进abcdfg.txt文件中具体看这里:http://hi.baidu.com/liuhelishuang/item/41f2bbf21 阅读全文
posted @ 2013-08-16 10:54 践道者 阅读(2475) 评论(0) 推荐(0) 编辑