code: def interact(self, banner=None):
          
          try:
              sys.ps1
          except AttributeError:
              sys.ps1 = ">>>"
          try:
              sys.ps2
          except AttributeError:
              sys.ps2 = "... "
          cprt = (
              'Type "help", "copyright", "credits" or "license" for ' "more information."
          )
          if banner is None:
              self.write("Python %s on %s\n%s\n" % (sys.version, sys.platform, cprt))
          else:
              self.write("%s\n" % str(banner))
          self.run_commands()
docs: Run an interactive session.