I understand a parallel execution using _thread. Is there any more pythonic way of writing the same code?

1
import _thread
def filho(tid):
    print('Ola da thread', tid)

def pai():
    i = 0
    while True:
        i += 1
        _thread.start_new_thread(filho, (i,))
        if input() == 'q': break

pai()

Is there any more pythonic way of writing the same code?

    
asked by anonymous 07.04.2018 / 22:36

0 answers