Over a million developers have joined DZone.

Simple Thread In Python

DZone's Guide to

Simple Thread In Python

· ·
Free Resource
Taken from this article.

import time
import thread

def myfunc(string,sleeptime):
    while 1:
        print string

thread.start_new_thread(myfunc,("Thread No:1",2))
# Then do other things.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}