<<--B站..........欢迎来到DGX的博客..........GitHub-->>

我的B站

使用Python操控cmd

import os
cmd = 'ipconfig /all'  #输入的命令
res = os.popen(cmd)
output_str = res.read()   # 获得输出字符串
print(output_str)

  

posted @ 2020-12-21 10:46  DG息  阅读(335)  评论(0)    收藏  举报