📜  python 检测 tty - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:08.406000             🧑  作者: Mango

代码示例1
if sys.stdout.isatty():
    # You're running in a real terminal
else:
    # You're being piped, redirected, cron