First commit
This commit is contained in:
57
IUT/Info1/TD/Exercices/workspace/main.py
Normal file
57
IUT/Info1/TD/Exercices/workspace/main.py
Normal file
@@ -0,0 +1,57 @@
|
||||
"""
|
||||
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()
|
||||
Reference in New Issue
Block a user