logo
  • 教程列表
  • SO官方文档
  • SYS
    • 命令行参数
    • 脚本名称
    • 标准错误流
    • 过早地结束进程并返回退出代码
  1. StackOverflow 文档
  2. Python Language 教程
  3. SYS
  4. 标准错误流

标准错误流

Created: November-22, 2018

# Error messages should not go to standard output, if possible.
print('ERROR: We have no cheese at all.', file=sys.stderr)

try:
    f = open('nonexistent-file.xyz', 'rb')
except OSError as e:
    print(e, file=sys.stderr)
  • 过早地结束进程并返回退出代码
  • 脚本名称

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明