stdout:标准输出python
stderr:标准错误命令行
print 至关于 sys.stdout.write() + 换行blog
一个将数据流写入文件的程序,文件名为:main.py字符串
def main(out=sys.stdout): config = 'Hello' out.write(config) if __name__ == '__main__': main()
在命令行下运行it
main.py > abcdfg.txtclass
就会将Hello字符串写进abcdfg.txt文件中程序
具体看这里:数据
http://hi.baidu.com/liuhelishuang/item/41f2bbf21b676215ce9f32bbdi