首页 > 代码库 > multiprocessing

multiprocessing

1.多进程

#!/bin/env python
from multiprocessing import Process
import os,time
def run_01():
    os.system(‘python /home/kkk/plt.py‘)

def run_02():
    while 1:  
        try:
            os.system(‘python /home/kkk/bing.py‘)
            time.sleep(300)
        except:
            pass

if __name__ == "__main__":
    p1=Process(target=run_01,)
    p2=Process(target=run_02,)
    p1.start()
    p2.start()


multiprocessing