code: def enter_alternate_screen(self):
          
          if not self._in_alternate_screen:
              GENERIC_READ = 0x80000000
              GENERIC_WRITE = 0x40000000
  
              # Create a new console buffer and activate that one.
              handle = self._winapi(windll.kernel32.CreateConsoleScreenBuffer, GENERIC_READ|GENERIC_WRITE,
                                    DWORD(0), None, DWORD(1), None)
  
              self._winapi(windll.kernel32.SetConsoleActiveScreenBuffer, handle)
              self.hconsole = handle
              self._in_alternate_screen = True
docs: Go to alternate screen buffer.