This file contains hidden or 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 discord | |
from discord.ext import commands | |
intents = discord.Intents.all() | |
client = commands.Bot(command_prefix='.', intents=intents) | |
client.remove_command('help') | |
# Words | |
hello_words = ['hello', 'hi', 'привет', 'privet', 'kу', 'ку', 'здарова'] | |
answer_words = ['узнать информацию о сервере', 'какая информация', 'команды', 'команды сервера', 'что здесь делать'] |
This file contains hidden or 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 bs4 import BeautifulSoup | |
import requests | |
import sqlite3 | |
import matplotlib | |
db = sqlite3.connect('posts.sqlite', check_same_thread=False) | |
connect = db.cursor() | |
connect.execute('''CREATE TABLE IF NOT EXISTS price ( | |
id INTEGER PRIMARY KEY AUTOINCREMENT, | |
full_name TEXT, |
This file contains hidden or 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
# предварительно чистим кэш чистим кэш видео в папке с файлом | |
try: | |
dir_name = "cache/" | |
files = os.listdir(dir_name) | |
fl_cnt = 0 | |
for i in files: | |
fl_cnt += 1 | |
print("cash_file:", fl_cnt, " ", i) | |
if fl_cnt >= 1: | |
shutil.rmtree(dir_name) |
This file contains hidden or 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 turtle | |
from turtle import speed, bgcolor, colormode, fd, rt, pencolor | |
speed(15) | |
bgcolor('black') | |
r, g, b = 255, 0, 0 | |
def polygon(n, size=80): | |
if n > 2: # <- многоугольников меньше 3 углов я не знаю :) |
This file contains hidden or 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 turtle | |
from turtle import speed, bgcolor, colormode, fd, rt, pencolor | |
speed(15) | |
bgcolor('black') | |
r, g, b = 255, 0, 0 | |
for i in range(255 * 2): | |
colormode(255) |
This file contains hidden or 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 turtle | |
from turtle import speed, bgcolor, colormode, fd, rt, pencolor | |
speed(50) | |
bgcolor('black') | |
r, g, b = 255, 0, 0 | |
for i in range(255 * 2): | |
colormode(255) |
This file contains hidden or 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 re | |
from tkinter import Tk | |
from tkinter.filedialog import askopenfilename | |
Tk().withdraw() | |
filepath = askopenfilename() | |
users_list = list() | |
# код для удаления из текстовика лишней инфы | |
with open(filepath) as f: |
This file contains hidden or 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 re | |
from tkinter import Tk | |
from tkinter.filedialog import askopenfilename | |
Tk().withdraw() | |
filepath = askopenfilename() | |
users_list = list() | |
# код для удаления из текстовика лишней инфы | |
with open(filepath, "r+") as f: |
This file contains hidden or 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 re | |
from tkinter import Tk | |
from tkinter.filedialog import askopenfilename | |
Tk().withdraw() | |
filepath = askopenfilename() | |
users_list = list() | |
# код для удаления из текстовика лишней инфы | |
with open(filepath) as f: |
This file contains hidden or 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 sqlite3 | |
import time | |
db = sqlite3.connect('users.sqlite') | |
connect = db.cursor() | |
f = open('text') | |
for line in f: | |
user_id = line |