-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRun.py
43 lines (40 loc) · 1.27 KB
/
Run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from Parser import *
def main():
try:
exec(open("Parser.py").read())
except FileNotFoundError:
print("Parser file not found")
os.system("pause")
system.exit(0)
except FileExistsError:
print("File does not exists")
os.system("pause")
system.exit(0)
except SystemExit:
pass
choice = str(input("Do you want to run the parser again? (y = Yes, n + No) ")).lower()
while choice == "y":
try:
exec(open("Parser.py").read())
except FileNotFoundError:
print("Parser file not found")
os.system("pause")
system.exit(0)
except FileExistsError:
print("File does not exists")
os.system("pause")
system.exit(0)
except SystemExit:
pass
choice = str(input("Do you want to run the parser again? (y = Yes, n + No) ")).lower()
while choice != "y" and choice != "n":
print("Please type a valid character (y or n)")
choice = str(input("Do you want to run the parser again? (y = Yes, n + No) ")).lower()
if choice == "n":
break
try:
shutil.rmtree("__pycache__")
except OSError as e:
pass
if __name__ == "__main__":
main()