This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_paste(content, holder, file_name='main.py'): | |
headers = {'Authorization': f'token {config.GIT_TOKEN}'} | |
payload = { | |
'description': f'From: {holder}', | |
'public': True, | |
'files': { | |
file_name: { | |
'content': content | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import peewee | |
db = peewee.SqliteDatabase('users.db') | |
class BaseModel(peewee.Model): | |
class Meta: | |
database = db | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def encode(url_id): | |
result = [] | |
while url_id > 0: | |
val = url_id % base | |
result.append(alphabet[val]) | |
url_id //= base | |
return ''.join(result[::-1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[['-', <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f27f0>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2860>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f28d0>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2940>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f29b0>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2a20>], [<pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2a90>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2b00>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2b70>, <pyrogram.client.types.bots.inline_keyboard_button.InlineKeyboardButton object at 0x7fc72d1f2be0>, <pyrogram.client.types.bo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
class Text(object): | |
def __init__(self): | |
self.text = '' | |
self.font = '' | |
def write(self, text): | |
self.text += text | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
import pymysql.cursors | |
import pymysqlpool | |
# Подключение к БД | |
connection = pymysql.connect(host='127.0.0.1', | |
user='root', | |
password='', | |
db='python', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Есть такой говно-код: | |
@bot.message_handler(commands=['newbh']) | |
def add(message): | |
banhammer = message.text.replace('/newbh ', '') | |
if banhammer != '': | |
banhammers = open(str(message.chat.id) + '.txt', 'w') | |
banhammers.write(banhammer) | |
banhammers.close() | |
@bot.message_handler(commands=['listbh']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Just testin'") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Just testin'") |