1
我创建了两个模块,它们中有一些函数。我在模块1中的单个函数中包含了2个函数,而在模块2中包含了导入的模块1,编译器中包含的函数often1
好像不会执行。穿线时不执行的函数
MODULE 1
import time,thread
def class_often():
while 1<2:
time.sleep(5)
print "Custom funtion not often runs."
def class_often1():
while 1<2:
time.sleep(2)
print "Custom funtion often runs."
def compiler():
class_often()
class_often1()
MODULE2
import time,d,thread
def often():
while 1<2:
time.sleep(2)
print "funtion not often runs."
def often1():
while 1<2:
time.sleep(2)
print "Function often runs."
thread.start_new_thread(often,())
thread.start_new_thread(often1,())
thread.start_new_thread(d.compiler,())
为什么你不使用[线程](http://stackoverflow.com/questions/5568555/thread-vs-threading)模块? – Pynchia