gpt4 book ai didi

process - Python - os.popen 和 subprocess.Popen 有什么区别?

转载 作者:太空狗 更新时间:2023-10-30 02:35:08 31 4
gpt4 key购买 nike

Python - os.popen 和 subprocess.Popen 有什么区别?

最佳答案

os 进程功能被认为已过时。 subprocess 模块是在 Python 2.4 中引入的,作为与子进程相关的几个旧模块和函数的统一的、更强大的替代品。它们被列为 here :

  • os.system
  • os.spawn*
  • os.popen*
  • popen2.*
  • 命令。*

os.popen 在 Python 2.6 中被弃用(但有趣的是,它在 Python 3 中没有被弃用,其中 it is implemented in terms of subprocess.Popen )。关于 how to replace it with subprocess.Popen 的文档中有一段.

关于process - Python - os.popen 和 subprocess.Popen 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4490686/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com