forked from JordanLeich/Ultimate-Calculator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
55 lines (46 loc) · 1.43 KB
/
Copy pathmain.py
File metadata and controls
55 lines (46 loc) · 1.43 KB
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
48
49
50
51
52
53
54
55
#!/usr/bin/python3
# Made by Jordan Leich on 6/1/2021, all contributors via GitHub can be found at
# https://github.com/JordanLeich/Ultimate-Calculator/graphs/contributors
# Imports
import calculators.calculators
import conversions.conversions
from modules import extras, colors
from modules.errors import Exit
from gui import *
def start():
"""
This is the first user input choice an end-user would receive, this is a main ui hub to access all the other areas of
this project.
"""
while True:
print(colors.green + '---Ultimate Calculator---', colors.reset)
choice = int(input('''
(1) All Calculators
(2) All Converters
(3) GUI Version (Do not use with main.exe)
(4) Extras
(5) Exit
Which option would you like to use: '''))
print()
if choice == 1:
try:
calculators.calculators.start()
except Exit:
break
elif choice == 2:
try:
conversions.conversions.start()
except Exit:
break
elif choice == 3:
print(colors.green + 'GUI Application is now running!\n', colors.reset)
start_gui()
elif choice == 4:
extras.start()
elif choice == 5:
break
else:
print(colors.red + "Invalid Choice...\n", colors.reset)
print("Reached end of the program... Ending program...\n")
if __name__ == '__main__':
start()