0

I am trying to make a script that restarts the execution of another script using a function. I have tried looking for a solution but haven't found anything that helps. Here's the code I have.

import sys, os, time
def crashHandle():
    sys.exit('An error occured.')
def haltAndRebootMain():

The function haltAndRebootMain is the one that restarts the main script. I need help executing it.

mdhcraft
  • 11
  • 1
  • 1
    does this help? https://stackoverflow.com/questions/11329917/restart-python-script-from-within-itself – bb1950328 Jun 08 '20 at 06:14
  • Lets have a basic explaination, to restart anything, we have to make everything to start from its default value, so you can have a function who is reseting/ making all values of variables to default and make a function call from where the execution had started for example you can have two functions: ```restart()``` and ```main()``` – JenilDave Jun 08 '20 at 06:19

0 Answers0