python stderr
print() function in python3 supports a 'file' argument, which specifies where the function should write to given objects to. If not specified, then the print statements has defaulted to sys.stdout.
python3中的print()函数支持一个'file'参数,该参数指定函数应将给定对象写入的位置。 如果未指定,则print语句默认为sys.stdout 。
打印到标准错误 (Printing to stderr)Using Python2
使用Python2
Example:
例:
import sysprint >> sys.stderr , "Include help for learning"Output
输出量
Include help for learningUsing Python3
使用Python3
Example:
例:
import sysprint('Include help for learning', file = sys.stderr)Output
输出量
Include help for learning翻译自: https://www.includehelp.com/python/how-to-print-to-stderr.aspx
python stderr