os.popen返回值
时间: 2023-10-31 20:57:02 浏览: 177
os.popen() 返回的是一个文件对象,可以通过该对象的 read() 方法读取到执行后的结果集。所以,os.popen() 的返回值不是返回码,而是执行后的结果。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Python 技术篇-通过管道命令获取cmd执行的结果,获取os.system()、subprocess.Popen()执行命令返回的结果](https://blog.csdn.net/qq_38161040/article/details/114879696)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [【python】os.system() & os.popen() 在 python 执行 cmd 指令](https://blog.csdn.net/weixin_42468475/article/details/128250078)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文