class Rabbit:
SPEED = 100
def go(self, SPEED: int):
self.SPEED = SPEED
self.SPEED = self.SPEED * 10
class A(Rabbit):
def write(self):
print(f'Speed: {self.SPEED}')
r = Rabbit()
b = A()
r.go(10)
b.write() # Speed: 100
from firebase_admin import db
ref = db.reference("/Goods/")
# выберет объект в Goods с полем Price который будет равен 80
ref.order_by_child("Price").equal_to(80).get()
# Выберет объект по ключу Egg в Goods
ref.child("Egg")
client.send_message('me', '<a href="tg://user?id=me">Mentions</a>', parse_mode="html")
import pyodbc
conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\Users\kiriharu\Desktop\testdb.accdb;')
cursor = conn.cursor()
cursor.execute('select * from sometable')
for row in cursor.fetchall():
print (row)
from telebot import apihelper
apihelper.proxy = {'https': 'socks5://telegram.vpn.net:55555'}
# {'https': 'socks5://айпи или домен:порт сервера'}
# если используется вход через пару логин:пароль
# {'https': 'socks5://логин:пароль@айпи или домен:порт сервера'}
import telebot, requests, bs4
from bs4 import BeautifulSoup
bot = telebot.TeleBot("TOKEN")
def pars():
page_link = 'https://random.cat/'
response = requests.get(page_link)
html = response.content
soup = BeautifulSoup(html, 'html.parser')
obj = soup.find('img', attrs={'id': 'cat'})
return obj.attrs['src']
@bot.message_handler(commands=['rcat'])
def randomcat(message):
bot.send_message(message.chat.id, pars())
bot.polling(none_stop=True)