📌  相关文章
📜  如果在终端中运行 python - Python 代码示例

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

代码示例1
import sys
if sys.stdin.isatty():
    # running interactively
    print "running interactively"
else:
    with open('output','w') as f:
        f.write("running in the background!\n")