等待用户输入`系统标准()`

2024-03-29 06:30:25 发布

您现在位置:Python中文网/ 问答频道 /正文

当我尝试some cmd | main.py时:

if not sys.stdin.isatty():
    input() # how to wait for user input but not from pipe?

我已经读了Python script not waiting for user input when ran from piped bash script,但我在windows中找不到{},并且用python代码处理它。在


Tags: frompycmdforinputifmainstdin