-
Notifications
You must be signed in to change notification settings - Fork 0
/
Run.py
47 lines (40 loc) · 1.34 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
44
45
46
47
from Dual_Converter import *
def main():
try:
exec(open("Dual_Converter.py").read())
except FileNotFoundError:
print("Converter file not found")
os.system("pause")
system.exit(0)
except FileExistsError:
print("Converter file does not exists")
os.system("pause")
system.exit(0)
except SystemExit:
pass
choice = str(input("Do you want to run the converter again? (y = Yes, n + No) ")).lower()
while choice == "y":
try:
exec(open("Dual_Converter.py").read())
except FileNotFoundError:
print("Converter file not found")
os.system("pause")
system.exit(0)
except FileExistsError:
print("Converter file does not exists")
os.system("pause")
system.exit(0)
except SystemExit:
pass
choice = str(input("Do you want to run the converter 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 converter again? (y = Yes, n + No) ")).lower()
if choice == "n":
break
try:
shutil.rmtree("__pycache__")
except OSError as e:
pass
if __name__ == "__main__":
main()