Use subprocess.Popen() rather than os.popen()