  
      def getch(self):
          """ Returns a keyboard character after kbhit() has been called.
              Should not be called in the same program as getarrow(). """
          if self.is_gui and os.name != "nt" or not sys.stdout.isatty():
              return None
          if os.name == "nt":
              return msvcrt.getch().decode("utf-8")
          return sys.stdin.read(1)
  
 
</s> remove         if self.is_gui or not sys.stdout.isatty():
 </s> add         if (self.is_gui or not sys.stdout.isatty()) and os.name != "nt": </s> remove         if self.is_gui and os.name != "nt" or not sys.stdout.isatty():
 </s> add         if (self.is_gui or not sys.stdout.isatty()) and os.name != "nt":
        if (self.is_gui or not sys.stdout.isatty()) and os.name != "nt":
  
      def getch(self):
          """ Returns a keyboard character after kbhit() has been called.
              Should not be called in the same program as getarrow(). """
        if (self.is_gui or not sys.stdout.isatty()) and os.name != "nt":
              return None
          if os.name == "nt":
              return msvcrt.getch().decode("utf-8")
          return sys.stdin.read(1)
  
keep keep keep keep replace keep keep keep keep keep
 bugfix: Windows - Stop training when terminate button pressed 
lib/keypress.py