import telebot from telebot import types import mysql.connector bot = telebot.TeleBot("TOKEN") db = mysql.connector.connect( host="localhost", user="root", password="", database="hosil" ) kontragent = db.cursor() kontragent.execute("SELECT * FROM kontragent") myresult = kontragent.fetchall() for x in myresult: print(x) cursor = db.cursor() cursor.execute("SELECT * FROM product") myresult1 = cursor.fetchall() for x in myresult1: print(x) @bot.message_handler(commands=['start']) def start(message): markup = types.ReplyKeyboardMarkup(resize_keyboard=True, row_width=2) btn1 = types.KeyboardButton("Склад") btn2 = types.KeyboardButton("Долг") markup.add(btn1, btn2) send_mess = f"Привет {message.from_user.first_name}!\nВведите " bot.send_message(message.chat.id, send_mess, parse_mode='html', reply_markup=markup) bot.polling(none_stop=True)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)