from multiprocessing import Process
def f1(n):#普通
print(f1)
if __name__ == '__main__':
lst = []
for i in range(10):
p1 = Process(target=f1,args = (i,))
p1.start()
lst.append(p1)
[p.join() for p in lst]
from multiprocessing import Process # 继承
class P1(Process);
def __init__(self,n);
super().__init__()
self.n = n
def run(self):
print(self.n)
if __name__ == '__main__':
p = P1(i)
p.start()
p.join()