import sh def flash_memory(imagefile): print("Sart programming Nand memory...") p = sh.bash("/usr/bin/igep-flash", "--skip-nandtest", "--image", "/opt/firmware/" + imagefile) if p.exit_code != 0: print("Flasher: Could not complete flashing task.") return 1 else: print("Flasher: NAND memory flashed succesfully.") return 0