对进程的创建
import time import multiprocessing def work1(): for i in range(10): print("我是work",i) time.sleep(0.5) if __name__ == '__main__': # 创建一个进程 process_obj = multiprocessing.Process(target=work1) # 启动进程 process_obj.start() print("woshi XXX") # process_obj.close()