wtorek, 1 października 2013

simple python threading example

#!/usr/bin/python

import threading
import datetime

class ThreadClass(threading.Thread):
    def run(self):
        now = datetime.datetime.now()
        print "%s says hello world at time: %s" %(self.getName(), now)
       
for i in range(2):
    t = ThreadClass()
    t.start()

Brak komentarzy:

Prześlij komentarz