除了常见的os.system和os.popen方法,官方强烈推荐使用subprocess来调用系统命令. 这个库用起来其实很简单,按照惯例先贴一下官文关键点: The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. The recommended approach to invoking su…