【发布时间】:2011-06-29 15:51:51
【问题描述】:
我希望在新线程的另一个 python 脚本中调用 python 函数。 我有使用 subprocess.Popen 的经验,但我用它在命令行中调用 .exe。有人推荐如何执行此操作或使用模块吗?
def main(argv):
call otherdef(1,2,3) in a new thread
sleep for 10 minutes
kill the otherdef process
def otherdef(num1, num2, num3):
while(True):
print num1
【问题讨论】:
-
你说
in a new thread是指in a new process -
不是杀死它,为什么你在 10 分钟后不让进程中止?
标签: python multithreading