问题 How do I make Popen use a fifo named pipe as stdin? import subprocess import os import time FNAME = 'myfifo' os.mkfifo(FNAME, mode=0o777) f = os.open(FNAME, os.O_RDONLY) process = subprocess.Popen( 'wait2.sh', shell=True, stdout=subprocess.PIPE, stdin=f, stderr=subprocess.PIPE, universal_newlines=True, ) while process.poll() is None: time.sleep(1) print("process.stdin", process.stdin) If I run this script and in a terminal window echo "Something" > myfifo The process exits with process.stdin