I use this code to reboot a pyqt5 application:
os.execl(sys.executable, sys.executable, *['"'+sys.argv[0]+'"', "-t", '2'])
The main problem with this command is that after pyqt5 exit on first exit, then i cannot manage the script (stop-debug) from PyCharm.
Any other related command?