import os import sys if(input("Would you like to restart? ") == "y"): os.execl(sys.executable, 'python', '"{}"'.format(__file__), *sys.argv[1:]) else: exit(0)