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

  • 關於本站
  • 免責聲明