Python 2 examples taken while learning SPSE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
308 B

#!/usr/bin/python
# -*- coding: utf-8 -*-
import threading
from threading import Thread
import time
def func1():
print 'Function 1'
time.sleep(2)
def func2():
print 'Function 2'
time.sleep(2)
if __name__ == '__main__':
Thread(target = func1).start()
Thread(target = func2).start()