首页 > 技术文章 > subprocess 子进程管理

Mint-diary 2021-03-10 13:24 原文

    module_base = pathlib.Path(__file__).absolute().parent.parent
    return_code = subprocess.call([config.python, '-m', 'link.db.operation', '-m', tmp_filename, tmp_out_filename], cwd=module_base)
    # return_code = subprocess.Popen([config.python, '-m', 'link.db.operation', '-m', tmp_filename, tmp_out_filename], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=module_base)
    # log("stage1_lsh_match_return_code: ",return_code.communicate())

 https://docs.python.org/zh-cn/3/library/subprocess.html

推荐阅读