#开进程的方法一:
import time
import random
from multiprocessing import Process
def piao(name):
print(‘%s piaoing‘ %name)
time.sleep(random.randrange(1,5))
print(‘%s piao end‘ %name)
p1=Process(target=piao,args=(‘egon‘,)) #必须加,号
p2=Process(target=piao,args=(‘alex‘,))
p3=Process(target=piao,args=(‘wupeqi‘,))
p4=Process(target=piao,args=(‘yuanhao‘,))
p1.start()
p2.start()
p3.start()
p4.start()
print(‘主线程‘)