Using Python to run executable and fill in user input

后端 未结 4 1232
太阳男子
太阳男子 2020-12-15 12:25

I\'m trying to use Python to automate a process that involves calling a Fortran executable and submitting some user inputs. I\'ve spent a few hours reading through similar

4条回答
  •  北海茫月
    2020-12-15 13:07

    As the spec says communicate() awaits for the subprocess to terminate, so the second call will be addressed to the finished process.

    If you want to interact with the process, use p.stdin&Co instead (mind the deadlock warning).

提交回复
热议问题