pty

Run command and get its stdout, stderr separately in near real time like in a terminal

大城市里の小女人 提交于 2019-11-26 02:37:12
问题 I am trying to find a way in Python to run other programs in such a way that: The stdout and stderr of the program being run can be logged separately. The stdout and stderr of the program being run can be viewed in near-real time, such that if the child process hangs, the user can see. (i.e. we do not wait for execution to complete before printing the stdout/stderr to the user) Bonus criteria: The program being run does not know it is being run via python, and thus will not do unexpected