import multiprocessing,threading
import time
import os
def threading_run():
print("线程ID",threading.get_ident())
t=threading.Thread(target=threading_run)
def info(title):
print(title)
print('module name:',__name__)
print("parent process:",os.getppid())
print("process id:",os.getpid())
def f(name):
time.sleep(1)
info("\033[31;1mfunction f\033[m")
print("Hello !",name)
t.start()
if __name__ == '__main__':
info('\033[32;1m main process line \033[0m]')
for i in range(5):
p = multiprocessing.Process(target=f,args=("bob"+ str(i),))
p.start()
p.join()