list_buttons_datas = [
('button 1', 'callback_data_1'),
('button 2', 'callback_data_2'),
('button 3', 'callback_data_3')
]
buttons_list = []
for name, data in list_button_name:
buttons_list.append([InlineKeyboardButton(text=name, callback_data=data)])
keyboard_inline_buttons = InlineKeyboardMarkup(inline_keyboard=buttons_list)
или так
list_buttons_datas = [
('button 1', 'callback_data_1'),
('button 2', 'callback_data_2'),
('button 3', 'callback_data_3')
]
# кол-во кнопок в ряду v
keyboard_inline_buttons = InlineKeyboardMarkup(row_width=1)
for name, data in list_button_name:
keyboard_inline_buttons.add(InlineKeyboardButton(text=name, callback_data=data))