code: def _reset_py_display() -> None:
          
          # Delete any prompts that have been set
          attributes = ['ps1', 'ps2', 'ps3']
          for cur_attr in attributes:
              try:
                  del sys.__dict__[cur_attr]
              except KeyError:
                  pass
  
          # Reset functions
          sys.displayhook = sys.__displayhook__
          sys.excepthook = sys.__excepthook__
docs: Resets the dynamic objects in the sys module that the py and ipy consoles fight over.
          When a Python console starts it adopts certain display settings if they've already been set.
          If an ipy console has previously been run, then py uses its settings and ends up looking
          like an ipy console in terms of prompt and exception text. This method forces the Python
          console to create its own display settings since they won't exist.
  
          IPython does not have this problem since it always overwrites the display settings when it
          is run. Therefore this method only needs to be called before creating a Python console.