© 1999-2048 dssz.net 粤ICP备11031372号
[其它] 对python 命令的-u参数详解
说明:缘起: 今天在看arcface的训练代码,在shell脚本中运行python 命令时后面加了-u 参数(python -u xx.py),于是对这个参数进行了下小研究。 准备知识 用网上的一个程序示例来说明,python中标准错误(std.err)和标准输出(std.out)的输出规则(标准输出默认需要缓存后再输出到屏幕,而标准错误则直接打印到屏幕): import sys sys.stdout.write("stdout1") sys.stderr.write("stderr1") sys.<weixin_38663007> 上传 | 大小:50kb