1import os
2import sys
3
4restart = input("\nDo you want to restart the program? [y/n] > ")
5
6if restart == "y":
7 os.execl(sys.executable, os.path.abspath(__file__), *sys.argv)
8else:
9 print("\nThe program will be closed...")
10 sys.exit(0)
11