【发布时间】:2015-11-30 05:47:00
【问题描述】:
我想在后台执行两个命令,第二个在后台执行。
import time
loop =[ 1,100]
start_time_loop = time.time()
for in loop:
print i
end_time_loop = time.time()
multi()
start_time_func = time.time()
c= 5*2
end_time_func = time.time()
当乘法完成时,循环应该在后台运行。
我要证明:
start_time_loop < start_time_func
end_time_func << end_time_loop
任何指针都会有所帮助。
【问题讨论】:
-
Python 不能使用本机运行多个进程。查看线程模块。
-
Python 可以使用多个进程 - 这就是
multiprocessing模块所做的。
标签: python multithreading python-3.x multiprocessing subprocess