In general, you should use run if you just need to run a command and capture its output…
Jump to turn (13)
- 1In general, you should use run if you just need to run a command and capture its
- 2please illustrate the standard input of process how to send data?
- 3but our process is a gui never ends
- 4after sending the data to stdin , how the gui uses it?
- 5i use the pyqt5 as gui , please illustrate how pyqt5 gets the stdin information
- 6i dont understand , every process has stdin?
- 7give me a python code to print the stdin and stdout
- 8can we read the stdout and print it out?
- 9no , i mean in the python code itself to extract the stdout of the process which
- 10or: 'io.TextIOWrapper' object has no attribute 'getvalue' something is wrong her
- 11sorry, it does not print any thing
- 12it still does not print any thing. why print write some t the sys.stdout?
- 13import sys stdinfileno = sys.stdin Keeps reading from stdin and quits only if th
- User
In general, you should use run if you just need to run a command and capture its output and Popen if you need more control over the process, such as interacting with its input and output streams.
The Popen class takes the same arguments as run(), including the args that specify the command to be run and other optional arguments such as stdin, stdout, stderr, shell, cwd, and env.
The Popen class has several methods that allow you to interact with the process, such as communicate(), poll(), wait(), terminate(), and kill(). please illustrate this paragraph and what is called the input and output stream?
- Assistant