import os cmd = \'ipconfig /all\' #输入的命令 res = os.popen(cmd) output_str = res.read() # 获得输出字符串 print(output_str) 相关文章: 2022-01-23 2021-07-25 2022-02-10 2021-11-12 2021-04-01 2022-02-07 2022-12-23 2021-11-06