Initial commit

This commit is contained in:
BarsTiger
2022-01-23 21:38:12 +02:00
commit 001eb4b555
15 changed files with 554 additions and 0 deletions

19
tui.py Normal file
View File

@@ -0,0 +1,19 @@
def menu(options: list) -> int:
for i in range(len(options)):
print(str(i) + ' - ' + options[i])
user_input = None
while user_input is None:
try:
user_input = int(input('\n> '))
if user_input < 0 or user_input >= len(options):
user_input = None
print('Choose number between 0 and ' + str(len(options) - 1))
except ValueError:
print('Choose number option')
return user_input
def get(description: str) -> str:
print(description)
return input('> ')