Use subprocess rather than os.popen