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='')
| 23439 | |
| 23440 | |
| 23441 | def 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 |
nothing calls this directly
no test coverage detected