#!/usr/bin/env python
# coding=utf-8

from multiprocessing import Process
import os

#子进程要执行的代码
def run_proc(name):
    print('运行子进程%s(%s)...' % (name,os.getpid()))

if __name__=='__main__':
    print('父进程 %s.' % os.getpid())
    p = Process(target=run_proc,args=('test',))
    print('子进程启动')
    p.start()
    p.join()
    print('子进程结束.')
