-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (27 loc) · 954 Bytes
/
main.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
import os
from utils.io import input_bounded_num
from views import View
def main():
choices = [
"CPU Scheduling",
"Memory Management",
"Disk Scheduling"
]
print("===== Operating System Simulator =====")
print(View.numbered_list(choices))
print()
print("What do you want to simulate?")
choice = input_bounded_num("Choice: ", max=len(choices)) - 1
entry_fn = None
if choices[choice] == choices[0]: from process_scheduling import main as entry_fn
if choices[choice] == choices[1]: from memory_managing import main as entry_fn
if choices[choice] == choices[2]: from disk_scheduling import main as entry_fn
is_running = True
while is_running:
os.system("cls")
entry_fn()
status = input("\n\nContinue (type quit to exit)...")
if status and status.lower() == "quit":
is_running = False
if __name__ == "__main__":
main()