def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the result of this function: {keyboard: [["A", "B"], ["C"]]}
See https://core.telegram.org/bots/api#replykeyboardmarkup
:param args: KeyboardButton to append to the keyboard
"""
def row(self, *args):
"""
Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#inlinekeyboardmarkup
:param args: strings
:return: self, to allow function chaining.
"""
[:-1]для того что бы \n обрезать
dict_r [st1[0]] = st1[1].strip()
import urllib.parse
def films(genre):
with open('films_genre_dict.json', encoding='utf-8') as f:
dict_films = json.load(f)
s = random.choice(dict_films[f'{genre}'])
return urllib.parse.quote(f'{s[0]} {s[1]}')
f'{genre}'
f"{search}"
f'{random_film}'
if guess == number:
print('Число выбрано верно')
else:
print('Число выбрано не верно')
if guess == number:
print('Число выбрано верно')
elif guess == 0:
print('Нельзя ввести ноль')
else:
print('Число выбрано не верно')