When should I use subprocess.Popen instead of os.popen?
问题 Seems both executes a subprocess and create a pipe to do in/out, just that the subprocess is newer. My question is, is there any function that subprocess.Popen can do while os.popen cannot, so that we need the new module subprocess ? Why Python language didn't choose to enhance os.popen but created a new module? 回答1: Short answer: Never use os.popen , always use subprocess! As you can see from the Python 2.7 os.popen docs: Deprecated since version 2.6: This function is obsolete. Use the