【发布时间】:2011-05-10 14:08:34
【问题描述】:
这个程序启动第一个程序。但我也想运行第二个并行。 如何使用脚本启动两个或多个程序?
# start many programs
execfile('C:/Dokumente und Einstellungen/schnei17/Desktop/python/zeit/1.py')
print 1
execfile('C:/Dokumente und Einstellungen/schnei17/Desktop/python/zeit/2.py')
print 2
【问题讨论】:
-
你为什么不使用
subprocess呢? -
subprocess使这更容易,除非您需要在进程之间共享数据,在这种情况下您将使用multiprocessing