58 lines
1.1 KiB
Python
58 lines
1.1 KiB
Python
"""
|
|
Main module for exercise creation
|
|
"""
|
|
|
|
VERSION = "1.0.0"
|
|
|
|
class CPP:
|
|
def __init__(
|
|
self,
|
|
exercise_name: str = "",
|
|
user_initialized : bool = False
|
|
) -> None:
|
|
self.exercise_name = exercise_name
|
|
|
|
if user_initialized:
|
|
self.setup_wizard()
|
|
|
|
def setup_wizard(self):
|
|
print_choices(
|
|
"Exercise name", ""
|
|
)
|
|
|
|
def print_choices(*choices: str) -> None:
|
|
for i, choice in enumerate(choices):
|
|
print(f"({i}) : {choice}")
|
|
|
|
def choose_language():
|
|
"""Function for choosing exercise language"""
|
|
print_choices("C", "C++", "Python")
|
|
|
|
user_input: str = input()
|
|
language = None
|
|
|
|
match user_input:
|
|
case "1":
|
|
language = CPP(user_initialized=True)
|
|
|
|
|
|
def choose_main():
|
|
...
|
|
|
|
def main():
|
|
"""Main function for user inputs"""
|
|
print(
|
|
f"Exercise creation tool v{VERSION}" \
|
|
"(1) : Create new exercise"
|
|
)
|
|
|
|
user_input = input()
|
|
|
|
match user_input:
|
|
case "1":
|
|
choose_language()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|