| Reply | « Previous Thread | Next Thread » |
|
Hi all,
I didn't read anything in the release notes about possible changes in the thread module.. but all the thread I made, worked so well in version 1.4.5 e now, with the version 1.9.2, when I run the same codes, nothing happens.. this simple code does nothing too! Code:
import thread
def speriamo(self):
num=0
while (1):
num=num+1
print num
return
def main():
thread.start_new_thread(speriamo, (None,))
print(u"Ciao")
return
main()
please, help me.. thank you! Emanuele |
|
Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
|
Quote:
Below, two ways to create threads using threading module (with and without classes). Code:
import threading
class Task(threading.Thread):
def __init__(self,arg):
threading.Thread.__init__(self)
self.arg = arg
def run(self):
for n in range(3):
print self.arg
def tsk(arg1,arg2,arg3):
# put a better thread body here
for n in range(3):
print arg1,arg2,arg3
t1 = threading.Thread(target=tsk,args=(1,"a",55))
t1.start()
t2 = Task("hello")
t2.start()
t1.join()
t2.join()
Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| emulator startup failed | hony | Symbian User Interface | 3 | 2008-11-11 07:07 |
| S60 SDK 3rd edition FP1 Emulator problem | justteam | Symbian Tools & SDKs | 12 | 2008-03-04 05:44 |
| Change title of a forum thread? | christoffer.haglund | General Discussion | 1 | 2007-08-15 17:57 |
| nokia 7210 modem via IR doesn't work ! | oussamaaiadi | PC Suite API and PC Connectivity SDK | 1 | 2003-03-06 11:46 |
| Questions about version code in MMS protocol | wangzhong | General Messaging | 1 | 2002-11-21 11:32 |