W
Threading Programming using Python
Https://www.ibm.com/developerworks/cn/aix/library/au-threadingpython/index.html
Import Threading Import datetime class ThreadClass (Threading. Thread): def Run (self): = datetime.datetime.now () Print '%s says Hello World at time:%s' % (Self.getname (), now) for in range (2): = threadclass () T.start ()
C:\>python E:\MATHpyCLI\au-Threadingpython.pythread-1Says Hello World at time: .-Geneva- in the: -:xx.141000thread-2Says Hello World at time: .-Geneva- in the: -:00.143000C +>python E:\MATHpyCLI\au-Threadingpython.pythread-1Says Hello World at time: .-Geneva- in the: -: Geneva.312000thread-2Says Hello World at time: .-Geneva- in the: -:02.313000C +>python E:\MATHpyCLI\au-Threadingpython.pythread-1Says Hello World at time: .-Geneva- in the: -:03.116000Thread-2Says Hello World at time: .-Geneva- in the: -:03.118000
Threading Programming using Python