real time subprocess.Popen via stdout and PIPE

前端 未结 8 1457

I am trying to grab stdout from a subprocess.Popen call and although I am achieving this easily by doing:

cmd = subprocess.Popen(\'         


        
8条回答
  •  我在风中等你
    2020-11-30 05:50

    The call to readlines is waiting for the process to exit. Replace this with a loop around cmd.stdout.readline() (note singular) and all should be well.

提交回复
热议问题