In [ ]:
#  派生子线程
import _thread

def child(tid):
    print('Hello from thread', tid)
    
def parent():
    i = 0
    while True:
        i += 1
        _thread.start_new_thread(child, (i,))
        if input() == 'q': break
            
parent()

In [5]:
import _thread as thread
help(thread.start_new_thread)


Help on built-in function start_new_thread in module _thread:

start_new_thread(...)
    start_new_thread(function, args[, kwargs])
    (start_new() is an obsolete synonym)
    
    Start a new thread and return its identifier.  The thread will call the
    function with positional arguments from the tuple args and keyword arguments
    taken from the optional dictionary kwargs.  The thread exits when the
    function returns; the return value is ignored.  The thread will also exit
    when the function raises an unhandled exception; a stack trace will be
    printed unless the exception is SystemExit.


In [ ]: