0
点赞
收藏
分享

微信扫一扫

python调用命令行


import subprocess

# 调用命令行,并获取输出结果
result = subprocess.run(['ls', '-l'], capture_output=True, text=True)

# 打印输出结果
print(result.stdout)


举报

相关推荐

0 条评论