で何も出力を与えない。ここに私のコードです:は、スレッドは、Python 3.6
import _thread
import time
def print_time(name, delay):
count=1
while count<=5:
time.delay(delay)
print ("Thread %s Time is %s"%(count, time.ctime(time.time())))
count = count+1
_thread.start_new_thread(print_time,("T-1",2))
_thread.start_new_thread(print_time,("T-2",4))
出力は、現在の時刻を伝える様々なラインでなければなりません。しかし、プログラムを実行した後、出力は得られずエラーもなくなりました。なぜこうなった?私はPython 3.6を使用しています。
私はインポートする必要がありますどのモジュールwhackmadoodle3000 @マルチプロセシングライブラリ –
を使用しますか? –
マルチプロセッシングhttps://docs.python.org/2/library/multiprocessing.html –