Python 官方文档:入门教程 => 点击学习
写了几个批处理,主要是一些Android调试命令,现在想用python来搞,感觉更酷一些吧。O(∩_∩)O~ 比如Ping命令: ping www.baidu.com 用Python来做,主要是使用了python标准库中的os库。 参见P
写了几个批处理,主要是一些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)
--结束END--
本文标题: Python调用Dos命令
本文链接: https://www.lsjlt.com/news/184398.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0