Traceback (most recent call last):
File "C:\Users\Admin\PycharmProjects\TTTBeta\main.py", line 40, in <module>
GridApp().run()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\app.py", line 949, in run
self._run_prepare()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\app.py", line 919, in _run_prepare
root = self.build()
File "C:\Users\Admin\PycharmProjects\TTTBeta\main.py", line 28, in build
box1 = gl.add_widget( Button(text="Ячейка 1", on_press=BoxOneP() ))
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\uix\behaviors\button.py", line 121, in __init__
super(ButtonBehavior, self).__init__(**kwargs)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\uix\label.py", line 318, in __init__
super(Label, self).__init__(**kwargs)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\uix\widget.py", line 369, in __init__
self.bind(**on_args)
File "kivy\_event.pyx", line 421, in kivy._event.EventDispatcher.bind
AssertionError: None is not callable
Traceback (most recent call last):
File "C:\Users\Admin\PycharmProjects\TTTBeta\main.py", line 40, in <module>
GridApp().run()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\app.py", line 950, in run
runTouchApp()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\base.py", line 582, in runTouchApp
EventLoop.mainloop()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\base.py", line 347, in mainloop
self.idle()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\base.py", line 391, in idle
self.dispatch_input()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\base.py", line 342, in dispatch_input
post_dispatch_input(*pop(0))
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\base.py", line 248, in post_dispatch_input
listener.dispatch('on_motion', etype, me)
File "kivy\_event.pyx", line 709, in kivy._event.EventDispatcher.dispatch
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\core\window\__init__.py", line 1412, in on_motion
self.dispatch('on_touch_down', me)
File "kivy\_event.pyx", line 709, in kivy._event.EventDispatcher.dispatch
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\core\window\__init__.py", line 1428, in on_touch_down
if w.dispatch('on_touch_down', touch):
File "kivy\_event.pyx", line 709, in kivy._event.EventDispatcher.dispatch
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\uix\widget.py", line 545, in on_touch_down
if child.dispatch('on_touch_down', touch):
File "kivy\_event.pyx", line 709, in kivy._event.EventDispatcher.dispatch
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\kivy\uix\behaviors\button.py", line 151, in on_touch_down
self.dispatch('on_press')
File "kivy\_event.pyx", line 705, in kivy._event.EventDispatcher.dispatch
File "kivy\_event.pyx", line 1248, in kivy._event.EventObservers.dispatch
File "kivy\_event.pyx", line 1172, in kivy._event.EventObservers._dispatch
TypeError: BoxOneP() takes 0 positional arguments but 1 was given
soup.find_all('a', class='some class')
не подошло. elif message.text == 'Своё сообщение':
bot.send_message(id, text="Введите своё сообщение: ")
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
but1 = types.KeyboardButton("Готово")
but2 = types.KeyboardButton("Назад")
bot.reply_to(message, "Бот запущен".format(message.from_user)
, parse_mode='html', reply_markup=markup)
markup.add(but1, but2)
import telebot
from telebot import types
import time
bot = telebot.TeleBot("")
i = 0
while i != 1:
@bot.message_handler(commands=['start'])
def send_welcome(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
but1 = types.KeyboardButton("1")
but2 = types.KeyboardButton("2")
but3 = types.KeyboardButton("3")
but4 = types.KeyboardButton("4")
but5 = types.KeyboardButton("Своё сообщение")
markup.add(but1, but2, but3, but4, but5)
bot.reply_to(message, "Бот запущен. Клавиатура загружена.".format(message.from_user)
,parse_mode='html',reply_markup=markup)
@bot.message_handler(func=lambda message: True)
def menu(message):
if message.chat.type == 'private':
if message.text != 'Своё сообщение':
sendmsg = message.text
bot.send_message(id, text=sendmsg)
time.sleep(2)
bot.send_message(id, text="Отправлено!")
elif message.text == 'Своё сообщение':
bot.send_message(id, text="Введите своё сообщение: ")
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
but1 = types.KeyboardButton("готово")
but2 = types.KeyboardButton("назад")
markup.add(but1, but2)
time.sleep(1)
customtext = message.text
bot.send_message(id, text=customtext)
bot.send_message(id, text="Отправлено!")
bot.polling()