在Python中创建多线程有以下三种常用的方法:
import threading def my_function(): # 线程执行的代码 my_thread = threading.Thread(target=my_function) my_thread.start()  from concurrent.futures import ThreadPoolExecutor def my_function(): # 线程执行的代码 with ThreadPoolExecutor() as executor: executor.submit(my_function)  from multiprocessing import Process def my_function(): # 线程执行的代码 my_thread = Process(target=my_function) my_thread.start()  以上三种方法都可以创建多线程,选择使用哪种方法取决于具体的需求和情况。