私はそう、私は良いことではなく、いくつかの奇妙な理由で、私のコードは、コマンドに従うことを望んでいないことができ、マルチスレッドで遊んしようとしています。 whileループと印刷に入ると仮定し、それはない、それはまた、すべてのエラーを上げていないので、どの行が上の間違いですね。私はこのpythonスクリプトで何の間違いをしていますか?
#!/usr/bin/env python
#
#
#
import random
import thread
import time
import sys
import os
def DisplayA(name,wait):
while True:
print 'Display: 1';time.sleep(wait)
def DisplayB(name,wait):
while True:
print 'Display: 2';time.sleep(wait)
def DisplayC(name,wait):
while True:
print 'Display: 3';time.sleep(wait)
thread.start_new_thread(DisplayA,('Display1',2))
thread.start_new_thread(DisplayB,('Display2',3))
thread.start_new_thread(DisplayC,('Display3',5))
これは私の端末から正常に動作します... ... –
あなたが見ている出力は何ですか?何もない?また、どのOS上のPythonのどのバージョン? –