What is the difference between os.popen and subprocess.Popen?

What is the difference between os.popen and subprocess.Popen?

+4
source share
1 answer

The functionality of the os process is deprecated. The subprocess module was introduced in Python 2.4 as a single, more powerful replacement for several older modules and functions related to subprocesses. They are listed here :

  • os.system
  • os.spawn*
  • os.popen*
  • popen2.*
  • commands.*

os.popen was deprecated in Python 2.6 (but, interestingly, not deprecated in Python 3, where it is implemented in terms of subprocess.Popen ). In the documentation for.

+6
source

Source: https://habr.com/ru/post/1332734/


All Articles