Skip to content

Instantly share code, notes, and snippets.

View AlgorithmAlchemy's full-sized avatar
💭
Open to job opportunities

AlgorithmAlchemy AlgorithmAlchemy

💭
Open to job opportunities
View GitHub Profile
@AlgorithmAlchemy
AlgorithmAlchemy / kaktus.py
Created July 1, 2022 03:29
discord_little_temka
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 = ['узнать информацию о сервере', 'какая информация', 'команды', 'команды сервера', 'что здесь делать']
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,
@AlgorithmAlchemy
AlgorithmAlchemy / dir_clear.py
Created June 1, 2022 19:59
Пересоздаём папку
# предварительно чистим кэш чистим кэш видео в папке с файлом
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)
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 углов я не знаю :)
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)
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)
@AlgorithmAlchemy
AlgorithmAlchemy / txt_drop.py
Created May 26, 2022 23:37
Удаляет дубликат и оригинал в txt
import re
from tkinter import Tk
from tkinter.filedialog import askopenfilename
Tk().withdraw()
filepath = askopenfilename()
users_list = list()
# код для удаления из текстовика лишней инфы
with open(filepath) as f:
@AlgorithmAlchemy
AlgorithmAlchemy / duble_delete.py
Last active May 26, 2022 23:08
Txt file duoble deleter python.py
import re
from tkinter import Tk
from tkinter.filedialog import askopenfilename
Tk().withdraw()
filepath = askopenfilename()
users_list = list()
# код для удаления из текстовика лишней инфы
with open(filepath, "r+") as f:
import re
from tkinter import Tk
from tkinter.filedialog import askopenfilename
Tk().withdraw()
filepath = askopenfilename()
users_list = list()
# код для удаления из текстовика лишней инфы
with open(filepath) as f:
@AlgorithmAlchemy
AlgorithmAlchemy / sqlite_from_txt.py
Last active June 29, 2023 10:50
sqlite3 заполнитель из txt
import sqlite3
import time
db = sqlite3.connect('users.sqlite')
connect = db.cursor()
f = open('text')
for line in f:
user_id = line