python pipe only stdin,out once, how to do twice or more time

前端 未结 2 1342
花落未央
花落未央 2021-01-28 10:51

success python pipe stdin, out only one time this source

main.py

import subprocess from subprocess import PIPE, STDOUT

player_pipe = subprocess.Popen([\         


        
2条回答
  •  走了就别回头了
    2021-01-28 11:53

    When you say "but I want twice or more time stdin, out", I'm not sure what you really mean.

    In a basic Linux/UNIX system, you have 1 - and only one - STDIN, STDOUT, and STDERR. Now, you can pipe things in and out, treating STDERR separately if you want, but you cannot just arbitrarily assign multiple inputs without setting up separate mechanisms (sockets, etc) to handle that within your program.

提交回复
热议问题