import threading from time import sleep def one(): while True: print 'ello' sleep(2) def two(): while True: raw_input() t1 = threading.Thread(target=one) t2 = threading.Thread(target=two) t1.start() t2.start() t1.join() t2.join()