-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (35 loc) · 991 Bytes
/
main.py
File metadata and controls
44 lines (35 loc) · 991 Bytes
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
import os
from sys import platform
# Check for user system
linux = False
bad_os = False
if platform == "linux" or platform == "linux2":
linux = True
elif platform == "win32":
bad_os = True
scripts = {
1: "maze/main.py",
2: "sudoku/main.py",
3: "crossword/main.py",
4: "graph_colorizer/main.py",
}
print("Hello! This is a script launcher. Choose a number of the script you'd like to run.")
print("Before you choose, close down the program and edit the coresponding file in data folder if you want to solve your problem\n")
print("\
1. Maze solver\n\
2. Sudoku solver\n\
3. Crossword solver\n\
4. Graph Colorer\n")
while True:
try:
choice = int(input("Enter a number: "))
command = scripts[choice]
break
except KeyError:
print("Enter a correct number")
except ValueError:
print("Enter a NUMBER")
if bad_os:
os.system("python -m " + command)
elif linux:
os.system("python " + command)