import pandas as pd
import numpy as np
import time
import threading
def run1():
time.sleep(5)
print("run1,Even start!")
def run2():
time.sleep(5)
print("run2,Even start!")
def run3():
print("run3,Even start!")
pro1 = threading.Thread(target=run1)
pro1.start()
pro2 = threading.Thread(target=run2)
pro2.start()
pro2.join()
pro3 = threading.Thread(target=run3)
pro3.start()
如上所示,任务一,任务二执行完成之后才会执行任务三,这是因为join()阻塞了线程