Replace os.system with subprocess.call