member.id
?id
import random
sentence = 'Если плоскость проходит через данную прямую, параллельную другой плоскости, и пересекает эту плоскость, то прямая пересечения плоскостей параллельна данной прямой'
chunk_size = 3
words = sentence.split()
chunked_words = []
for i in range(0, len(words), chunk_size):
chunked_words.append(words[i:i + chunk_size])
random.shuffle(chunked_words)
new_sentence = ''
for chunk in chunked_words:
new_sentence += ' '.join(chunk) + ' '
print(new_sentence)
markup = types.InlineKeyboardMarkup(row_width=5)
buttons = []
for i in range(-12, 15):
if i < 0:
button = types.InlineKeyboardButton(f'{i}', callback_data=f'{i}')
elif i == 0:
button = types.InlineKeyboardButton(f'±{i}', callback_data=f'{i}')
else:
button = types.InlineKeyboardButton(f'+{i}', callback_data=f'{i}')
buttons.append(button)
markup.add(*buttons)
import re
pattern = ''.join(rf'\b{word}\b|' for word in cms)[:-1]
pattern = f'({pattern})'
def repl(match):
return match.group(1).upper()
bs = re.sub(pattern, repl, Bs)
print(bs)
reaction
и user
Cog
class Deleted(commands.Cog):
location = types.InputDocumentFileLocation(id=5289805549955714500, access_hash=6708206575358420852, file_reference=b'\x04GG>\x97\x00\x00\x03\x1f`\xad?\x1a\xc1\xbc\x8c\xba%\x82J\xa9\xa8\xd4\xa7\xd2\xa1\xd29\xde', thumb_size='100')
with open('result.mp4', 'wb') as f:
client.download_file(input_location=location, file=f)
with open('result.mp4', 'wb') as f:
msg.download_media(file=f)
table
, а не tabel
lxml
переключить тогда.def get_content(html):
soup = BeautifulSoup(html, 'lxml')
items = soup.find('table', class_='rating').find_all('tr')
chars = []
for item in items:
chars.append({
'nick': item.find('a', class_='hint--bottom-right').text,
'server': item.find('a', class_='realm').text,
'link': item.find('a', class_='hint--bottom-right').get('href')
})
print(chars)