-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.py
More file actions
33 lines (33 loc) · 1.44 KB
/
command.py
File metadata and controls
33 lines (33 loc) · 1.44 KB
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
import sys
from greeting import greet_user
from add import add_note
from list import list_notes
from edit import edit_note
from delete import delete_note
from date import filter_notes_by_date
greet_user()
while True:
command = input("Введите команду: ")
if command == 'add':
title = input("Введите заголовок заметки: ")
message = input("Введите тело заметки: ")
add_note(title, message)
print("Заметка успешно сохранена")
elif command == 'list':
list_notes()
elif command == 'filter':
date = input("Введите дату для фильтрации заметок (формат YYYY-MM-DD): ")
filter_notes_by_date(date)
elif command == 'edit':
index = int(input("Введите номер заметки для редактирования: "))
title = input("Введите новый заголовок заметки: ")
message = input("Введите новое тело заметки: ")
edit_note(index, title, message)
elif command == 'delete':
index = int(input("Введите номер заметки для удаления: "))
delete_note(index)
elif command == 'exit':
print("Выход из программы...")
sys.exit()
else:
print("Неизвестная команда, попробуйте снова.")