FGHT
Üye
Python Thread Kullanımı
Telefonda thread modülünü kullanmayı deniyorum ama nedense thread modülü çalışmıyor. Herhangi bir hata kodu da vermiyor ve aynı kod pc de dorunsuz çalışıyor. Bu sorunu nasıl halledebilirim bilgisi olan var mı? Python sürümü 1.4.5 ve telefon nokıa 5800. Kod:
Kod:
#!/usr/bin/python
import thread
import time
# Define a function for the thread
def print_time( threadName, delay):
count = 0
while count < 5:
time.sleep(delay)
count += 1
print "%s: %s" % ( threadName, time.ctime(time.time()) )
# Create two threads as follows
try:
thread.start_new_thread( print_time, ("Thread-1", 2, ) )
thread.start_new_thread( print_time, ("Thread-2", 4, ) )
except:
print "Error: unable to start thread"
while 1:
pass