os.system(command) 1.python常用的外部程序调用方法之os.system(command) 相当于在 shell 中执行 command 指令 ,简单来说 ,在 只要字符串可以在 l shell 中运行 , 就可,以将其作为 os.system 在 的参数,在 Python 文件中执行系统命令。 参照下面代码 import os def foo1(command): os.system(command)#相当于在shell中执行command 指令 print('画板使用完毕') foo1(