#!/usr/bin/python
# _*_ coding: utf-8 _*_

import multiprocessing
import os

def run_proc(name):
    print 'Run child process %s (%s) ...' % (name, os.getpid())

if __name__ == '__main__':
    print 'Parent process is %s' % (os.getpid())
    p = multiprocessing.Process(target = run_proc, args = ('test',))
    print 'Process will start'
    # 启动子进程
    p.start()
    # 等待子进程结束后再继续向下运行
    p.join()
    print 'Process end.'


