我想stdout在运行os.system调用后获取in变量。
让我们以这行为例:
batcmd="dir"
result = os.system(batcmd)
result将包含错误代码(对于上面的示例,stderr 0在Windows或1某些Linux下)。
如何stdout在执行的命令中不使用重定向的情况下获取上述命令的?
相关分类