import multiprocessing
import time
def dance():
for item in range(1, 5):
print("跳舞...")
time.sleep(0.2)
pass
pass
def sing():
for item in range(1, 5):
print("唱歌...")
time.sleep(0.2)
pass
pass
if __name__ == "__main__":
# group 进程组,默认是None,一般不会使用
# target 所需要执行的任务
# name 进程名,默认是process-1,2,.....
# args 参数(元组类型)
dance_process = multiprocessing.Process(target=dance)
dance_process.start()
sing()