first step

This commit is contained in:
2025-03-08 13:49:29 +03:00
parent e5d6ead38e
commit 5a6fc1d8ca
2 changed files with 14 additions and 7 deletions
+13 -7
View File
@@ -1,11 +1,17 @@
import re
import readline
def startup_hook():
readline.insert_text('from startup_hook')
def set_description_message_pattern(pattern: str) -> None:
first_check = re.match(r'.*command.*', pattern)
second_check = re.match(r'.*{description}.*', pattern)
if bool(first_check) and bool(second_check):
print('Success')
def pre_input_hook():
readline.insert_text('from pre_input_hook')
readline.redisplay()
readline.set_startup_hook(startup_hook)
readline.set_pre_input_hook(pre_input_hook)
readline.parse_and_bind('tab: complete')
set_description_message_pattern('Invalid des{ommand}cription pattern')
line = ''
while line != 'stop':
line = input('!("stop" to quit) Ввод текста: => ')
print (f'Отправка: {line}')
+1
View File
@@ -33,4 +33,5 @@ numpy = "^2.2.2"
word2number = "^1.1"
numexpr = "^2.10.2"
requests = "^2.32.3"
pyreadline3 = "^3.5.4"