Python Tutorial

Thursday, October 28, 2010

Python Threading Use A Thread Class

 '''
    This code use a thread class
    - Save this class named 'AnyName.py'
 - Run this code you need class 'ThreadClass.py'
'''
import ThreadClass

for i in range(1,4):
    threadObject=ThreadClass.ThreadClass(i)
    threadObject.start()



Output:
output:  output: 1output:  
 23

output:  1
output:  2output: 
 3
output:  1
output: output:   32

0 comments:

Post a Comment