subprocess模块可以调用外部命令,使用它可以方便的执行操作系统支持的命令 例如在linux中调用shell #!/usr/bin/python3.6import subprocessa = subprocess.run("ls",shell=True)