8
在Python中,是否可以在不阻塞线程的情况下执行非阻塞系统调用?即,我能避免:在python中,我该如何做一个非阻塞的系统调用?
import thread
thread.start_new_thread(os.system,('cmd',))
在Python中,是否可以在不阻塞线程的情况下执行非阻塞系统调用?即,我能避免:在python中,我该如何做一个非阻塞的系统调用?
import thread
thread.start_new_thread(os.system,('cmd',))
使用subprocess模块(POPEN),并具有写入文件的结果。您可以“等待”子流程终止或继续进行其他业务并轮询文件中的结果等。
谢谢jldupont。 – 2009-10-23 14:17:45