python 与命令 1、执行命令行中的命令有两种方法:在此以Linux常用的ls命令为例, (1)os.system('ls -l') (2)import subprocess subprocess.call('ls -l'.split())