天天看點

學習Python os.popen啟動程式

os.popen()是非阻塞的。(差別于os.system(),該方法是阻塞的,需要等待程序傳回值)

os.popen()傳回對象的read()方法可以實作阻塞。

os.popen()傳回對象:The return value is an open file object connected to the pipe, which can be read or written depending on whether mode is ‘r’ (default) or ‘w’ ref Python Doc