import threading
threads = []
for item in data:
threads.append(threading.Thread(target=submit, args=(item,)))
# 启动线程
for thread in threads:
thread.start()
# 等待线程结束
for thread in threads:
thread.join()
submit是自定义的函数 item是submit接收的参数