How to determine pid of process started via os.system

前端 未结 3 509
南笙
南笙 2020-12-19 04:51

I want to start several subprocesses with a programm, i.e. a module foo.py starts several instances of bar.py.

Since I sometimes have to te

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 05:31

    You could use os.forkpty() instead, which, as result code, gives you the pid and fd for the pseudo terminal. More documentation here: http://docs.python.org/2/library/os.html#os.forkpty

提交回复
热议问题