code: def do_hotswap(self, msg):
          
          #: Show hotswap tooltip
          try:
              self.app.widget.showTooltip("Hot swapping...", now=True)
          except:
              pass
          self.save_changed_files(msg)
  
          hotswap = self.hotswap
          app = self.app
          try:
              print("Attempting hotswap....")
              with hotswap.active():
                  hotswap.update(app.view)
          except:
              #: Display the error
              app.send_event(Command.ERROR, traceback.format_exc())
docs: Attempt to hotswap the code