brintos

brintos / llvm-project-archived public Read only

0
0
Text · 457 B · 36f237a Raw
21 lines · python
1import interactive_host2import sys3 4 5def main(args):6    class Advisor:7        to_return = False8 9        def advice(self, _):10            # The adice will be a sequence of yes/no/yes/no/...11            # see ../interactive-mode.ll12            self.to_return = not self.to_return13            return int(self.to_return)14 15    a = Advisor()16    interactive_host.run_interactive(args[0], a.advice, args[1:])17 18 19if __name__ == "__main__":20    main(sys.argv[1:])21