MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / execute_restart

Function execute_restart

PySimpleGUI/PySimpleGUI.py:23441–23458  ·  view source on GitHub ↗

Restarts your program. The currently running process is exited and a new one is started. NOTE - this function calls exit and thus will not return :param your_filename: Set this parm to __file__ :type your_filename: str :param parms: Parameters to pas

(your_filename, parms='')

Source from the content-addressed store, hash-verified

23439
23440
23441def execute_restart(your_filename, parms=''):
23442 """
23443 Restarts your program. The currently running process is exited and a new one is started.
23444 NOTE - this function calls exit and thus will not return
23445
23446 :param your_filename: Set this parm to __file__
23447 :type your_filename: str
23448 :param parms: Parameters to pass to your program when it's restarted
23449 :type parms: str
23450
23451 """
23452
23453 try:
23454 execute_py_file(your_filename, parms, pipe_output=False, wait=False) # restart this program
23455 exit() # Exit instead of returning
23456 except Exception as e:
23457 print(f'ERROR restarting your program: {your_filename}')
23458 exit()
23459
23460
23461

Callers

nothing calls this directly

Calls 1

execute_py_fileFunction · 0.70

Tested by

no test coverage detected