Threading Programming using Python

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.