def main(unused_argv): if FLAGS.update_path: generate_playthrough.update_path(FLAGS.update_path) else: if not FLAGS.game: raise ValueError("Must specify game") text = generate_playthrough.playthrough( FLAGS.game, FLAGS.seed, alsologtostdout=FLAGS.alsologtostdout) if FLAGS.output_file: with open(FLAGS.output_file, "w") as f: f.write(text) else: print(text, end="")
def main(unused_argv): if FLAGS.update_path: generate_playthrough.update_path(FLAGS.update_path) else: if not FLAGS.game: raise ValueError("Must specify game") actions = FLAGS.actions if actions is not None: actions = [int(x) for x in actions] text = generate_playthrough.playthrough( FLAGS.game, actions, alsologtostdout=FLAGS.alsologtostdout) if FLAGS.output_file: with open(FLAGS.output_file, "w") as f: f.write(text) else: logging.info(text)