方法一: python
import os os.system('cmd')
缺点是没法得到返回值ide
方法二:对象
import os a = os.popen('cmd')
此时,a是一个文件对象,能够调用read()、readline()等方法,也能够直接迭代得到此文件对象的内容。cmd