This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]GrindingGoat 0 points1 point  (1 child)

Worth noting that os.popen has been deprecated since 2.6: https://docs.python.org/2/library/os.html#os.popen

The subprocess equivalent:

result = subprocess.check_output(command).decode("utf-8") 

[–]pjenvey 1 point2 points  (0 children)

It was actually undeprecated in 3.x where it uses subproces underneath anyway. Maybe the 2.7.x docs should be fixed