Use the subprocess module, not os.popen2, for Python 3 compatibility.