内置功能:
execfile
原文链接:https://www.f2er.com/bash/391259.htmlexecfile('helloworld.py')
自2.6:popen后弃用
import os os.popen('python helloworld.py') # Just run the program os.popen('python helloworld.py').read() # Also gets you the stdout
预先使用:subprocess
import subprocess subprocess.call(['python','helloworld.py']) # Just run the program subprocess.check_output(['python','helloworld.py']) # Also gets you the stdout
阅读文档的详细信息:-)