import os
cmd = 'dir'
with os.popen(cmd) as f:
res = f.read()
print(res)
Python获取dos输出
最新推荐文章于 2025-08-27 16:44:20 发布
import os
cmd = 'dir'
with os.popen(cmd) as f:
res = f.read()
print(res)