发布时间:2019-07-26 09:46:25编辑:auto阅读(2387)
写了几个批处理,主要是一些Android调试命令,现在想用python来搞,感觉更酷一些吧。O(∩_∩)O~
比如Ping命令:
ping www.baidu.com
用python来做,主要是使用了python标准库中的os库。
参见Python文档The Python Standard Library => Generic Operating System Services => os — Miscellaneous operating system interfaces.
这里介绍的比较全面,而且这个库我们用的也较多。
我们会用到os.system()方法:
import os
cmd = 'cmd.exe /k ping www.baidu.com'
os.system(cmd)
上一篇: 图灵Python图书一览表
下一篇: Python基础入门笔记(一)
50018
49270
39928
36971
31368
28211
27169
21960
21905
20243
297°
251°
231°
402°
411°
1015°
1905°
1774°
1430°
2868°