S
S
Sasha Fedorov2021-03-13 12:07:44
Python
Sasha Fedorov, 2021-03-13 12:07:44

How to display all records from a column on bot buttons?

# КЛАВИАТУРА
keyboard_del = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
# ВЫВОД ДАННЫХ
cur.execute("SELECT * FROM zametki")
rows = cur.fetchall()

# УДАЛЕНИЕ ЗАМЕТОК
def delete_zametku(message):
    for i in rows:
        keyboard_del.row(i[1])
# ОБРАБОТКА ПРОСМОТРА ЗАМЕТОК
#Без ошибок,ничего не выводится

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexa2007, 2021-03-14
@Alexa2007

def buttons_create(buttons=[]):
  keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True,resize_keyboard=True)
  for _ in buttons:
    keyboard.add(_)
  return keyboard

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question