I restart my pyqt5 app programatically, how do I get wing to run on new process?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

I restart my pyqt5 app programatically, how do I get wing to run on new process?

WingIDE - User mailing list
    def restart(self):
        """Restarts the current program, with file objects and descriptors
           cleanup
        """      
        with open(self.restart_pickle_name, 'wb') as pickle_file:
            pickle.dump(self, pickle_file)
        
        self.editor.save_all_source_codes()
        
        for window in self._windows.values():
            window.close()
        self._windows.clear()
        try:
            p = psutil.Process(os.getpid())
            #for handler in p.open_files() + p.get():
                #os.close(handler.fd)
        except Exception as e:
            if __debug__:
                raise e
            logging.error(e)
        import sys
        
        python = sys.executable
        os.execl(python, python, '"{}"'.format(self.main_module()))        
        #os.execlp(python, '"{}"'.format('bubble_like_app.py'))


That's how I'm restarting, but of course Wing's debug session ends.  So how would I continue it onto the new process?

_________________________________________________
Wing Python IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: I restart my pyqt5 app programatically, how do I get wing to run on new process?

WingIDE - User mailing list
This should work if you have multiprocess debugging enabled.  What is
Debug Child Processes set to on the Debug / Execute page of the Project
Properties dialog?

Thanks,

John

On 4/26/19 3:15 AM, Luna Tuna via wingide-users wrote:

>              def restart(self):
>                  """Restarts the current program, with file objects and
>         descriptors
>                     cleanup
>                  """
>                  with open(self.restart_pickle_name, 'wb') as pickle_file:
>                      pickle.dump(self, pickle_file)
>
>                  self.editor.save_all_source_codes()
>
>                  for window in self._windows.values():
>                      window.close()
>                  self._windows.clear()
>                  try:
>                      p = psutil.Process(os.getpid())
>                      #for handler in p.open_files() + p.get():
>                          #os.close(handler.fd)
>                  except Exception as e:
>                      if __debug__:
>                          raise e
>                      logging.error(e)
>                  import sys
>
>                  python = sys.executable
>                  os.execl(python, python,
>         '"{}"'.format(self.main_module()))
>                  #os.execlp(python, '"{}"'.format('bubble_like_app.py'))
>
>
>
>     That's how I'm restarting, but of course Wing's debug session ends.
>     So how would I continue it onto the new process?
>
>
> _________________________________________________
> Wing Python IDE users list
> http://wingware.com/lists/wingide
>

_________________________________________________
Wing Python IDE users list
http://wingware.com/lists/wingide