Клуб программистов
1.66K subscribers
217 photos
5 videos
75 files
189 links
Добро пожаловать в клуб программистов 👨‍💻👨‍💻

✔️ Сбор кодеров с инета ✔️

✅️ Здесь можно найти:

👨‍💻Исходники программ/игр на python + ссылки на тикток ролики
🗿IT мемы
🔺️Уведомления о новых роликах на ютуб канал

▪️реклама/сотрудни-во: @clb_prog
Download Telegram
Всплывающее окно на python

Исходный код:

from pyautogui import alert
import time


question = str(input('Хотите увидеть вспылающее окно?\n'))


if question == 'да':
    time.sleep(2)
    alert('Вот оно ;)', 'Всплывающее окно')
   
else:
    print('Ок')


Ссылка на ролик: https://vt.tiktok.com/ZS2fgxNEu/
👍31🔥1
🔗 ССЫЛКИ НА ДРУГИЕ СОЦ СЕТИ И Т.Д ⤵️


〰️〰️〰️〰️〰️〰️〰️〰️〰️
🗼Тикток
〰️〰️〰️〰️〰️〰️〰️〰️〰️


〰️〰️〰️〰️〰️〰️〰️〰️〰️
🔺️Ютуб канал
〰️〰️〰️〰️〰️〰️〰️〰️〰️


〰️〰️〰️〰️〰️〰️〰️〰️〰️
💬 Наш Чат
〰️〰️〰️〰️〰️〰️〰️〰️〰️


〰️〰️〰️〰️〰️〰️〰️〰️〰️
🔥 Буст канала
〰️〰️〰️〰️〰️〰️〰️〰️〰️

⚕️Подробная инфа о тг канале в описании

▪️реклама/сотрудничество: @clb_prog
❤‍🔥711
Измерение скорости интернета с помощью python

Исходный код:

import speedtest


def test_speed():
    print('подождите...')
   
    speed_test = speedtest.Speedtest()
   
    download_speed = speed_test.download() / 1_000_000
    upload_speed = speed_test.upload() / 1_000_000
   
    print(f"\nСкорость скачивания: {download_speed:.2f} Mbps")
    print(f"Скорость загрузки: {upload_speed:.2f} Mbps")
   

test_speed()


Ссылка на ролик: https://vt.tiktok.com/ZS25YLmA6/
👍5
🤣11❤‍🔥4👍3
С днём программиста 🥳
🎉152
💠 Преобразование речи в текст на python

Исходный код:

import speech_recognition as sr

r = sr.Recognizer()


def transformation():
   
    with sr.Microphone() as source:
        print("ГОВОРИТЕ...")
        audio = r.listen(source)

    try:
        text = r.recognize_google(audio, language="ru-RU")
        print(f"Вы сказали: {text}")
       
    except sr.UnknownValueError:
        print("Не удалось распознать речь")
       
       
transformation()


Ссылка на ролик: https://vt.tiktok.com/ZS2H1uan1/
👍4❤‍🔥1🔥11
🔹️ Переводчик с интерфейсом на python

Исходный код:

from tkinter import *
from tkinter import ttk
from googletrans import Translator


def translate():
    for language, suffix in languages.items():
        if comboTwo.get() == language:
            text = t_input.get('1.0', END)
            translation = translator.translate(text, dest=suffix)
            t_output.delete('1.0', END)
            t_output.insert('1.0', translation.text)


root = Tk()
root.geometry('500x350')
root.title('Переводчик')
root.resizable(width=False, height=False)
root['bg'] = 'black'
translator = Translator()

languages = {'Русский': 'ru', 'Английский': 'en', 'Французский': 'fr'}

header_frame = Frame(root, bg='black')
header_frame.pack(fill=X)

header_frame.grid_columnconfigure(0, weight=1)
header_frame.grid_columnconfigure(1, weight=1)
header_frame.grid_columnconfigure(2, weight=1)

comboOne = ttk.Combobox(header_frame,
                        values=[lang for lang in languages], state='readonly')
comboOne.current(0)
comboOne.grid(row=0, column=0)

label = Label(header_frame, fg='white', bg='black', font='Arial 17 bold', text='->')
label.grid(row=0, column=1)

comboTwo = ttk.Combobox(header_frame,
                        values=[lang for lang in languages], state='readonly')
comboTwo.current(1)
comboTwo.grid(row=0, column=2)

t_input = Text(root, width=35, height=5, font='Arial 12 bold')
t_input.pack(pady=20)

btn = Button(root, width=45, text='Перевести', command=translate)
btn.pack()

t_output = Text(root, width=35, height=5, font='Arial 12 bold')
t_output.pack(pady=20)

root.mainloop()


Ссылка на ролик: https://vt.tiktok.com/ZS29auXRG/
7
Конвертер видео в mp4 на python

Исходный код:

from moviepy.editor import *


def mp4(input_file, output_file):
   
    try:
        video = VideoFileClip(input_file)

        video.write_videofile(output_file, codec='libx264')

        print('Успешно!')
   
    except Exception as e:
        print(f"Произошла ошибка: {e}")


mp4("video.mkv", "output.mp4")


Ссылка на ролик: https://vt.tiktok.com/ZS24NB9mk/
❤‍🔥5👍1
👏8👍1👌1
🍄 Генератор фейковых данных на python

Исходный код:

from faker import Faker
from time import sleep


faker = Faker('Ru')


def generate_dates():
    while True:
        name = faker.name()
        email = faker.email()
        address = faker.address()
        phone_number = faker.phone_number()
        city = faker.city_name()
       
        sleep(1.5)
        print(f'\n{name}')
        print(email)
        print(address)
        print(phone_number)
        print(city)
       
       
generate_dates()


Результат в ролике: https://vt.tiktok.com/ZS2gN7pqw/
👍5❤‍🔥11
9👍2🕊1
🔋 Узнаём заряд батареи пк с помощью python

Исходный код:

import tkinter as tk
import psutil
from tkinter import messagebox


def check():
    bat = psutil.sensors_battery()
    percent = f'Заряд: {int(bat.percent)}%'
   
    return percent


def show_battery_status():
    status = check()
    messagebox.showinfo("Заряд батареи", status)


root = tk.Tk()
root.title("Статус Заряда Батареи")
root.geometry("300x150")


button = tk.Button(root, text="Показать заряд батареи", command=show_battery_status, font=('Arial', 16))
button.pack(pady=50)


root.mainloop()


Результат в ролике: https://www.tiktok.com/t/ZTFDbEQQd/
🔥31👍1
🥑 Матрица как в фильмах на python

Исходный код:

import pygame
import random

pygame.init()

font = pygame.font.SysFont('宋体', 25)
screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)

screenwidth = screen.get_width()
screenheight = screen.get_height()

surface = pygame.Surface((screenwidth, screenheight), pygame.SRCALPHA)
surface.fill((0, 0, 0, 10))

texts = [font.render(i, True, (0, 255, 0)) for i in ['0', '1']]

lst = list(range(99))

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            exit()
       
        if event.type == pygame.KEYUP:
            if event.key == pygame.K_ESCAPE:
                pygame.display.set_mode((600, 600))
           
            if event.key == pygame.K_f:
                pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
               
    pygame.time.delay(50)
    screen.blit(surface, (0, 0))
   
    for i in range(len(lst)):
        text = random.choice(texts)
        screen.blit(text, (i * 20, lst[i] * 20))
        lst[i] += 1

        if random.random() < 0.05:
            lst[i] = 0
   
    pygame.display.flip()


Результат в ролике: https://vt.tiktok.com/ZS27LaH1j/
👍5
+ хп
👏102👍2
Танцующий человечек на python

Исходный код:

import time
import os


frames = [
    r"""
    O
   /|\
   / \
    """,
    r"""
    \O/
     |
    / \
    """,
    r"""
     O
    /|\
    / \
    """,
    r"""
    O/
     |
    / \
    """
]


def clear_console():
    os.system('cls' if os.name == 'nt' else 'clear')


while True:
    for frame in frames:
        clear_console()
        print(frame)
        time.sleep(0.3)


Результат: https://www.tiktok.com/t/ZTF5SHGtu/
😁51👍1
Современные комментарии в коде:
👏8👍1🔥1🌚1
🌀 Конвертер валют на python

Исходный код:

import requests

available_currencies = {
    "USD": "Доллар США",
    "EUR": "Евро",
    "RUB": "Российский рубль",
    "KZT": "Казахский тенге",
    "UAH": "Украинская гривна",
}

def display_available_currencies():
    print("Доступные валюты:")
    for code, name in available_currencies.items():
        print(f"{code}: {name}")

def get_exchange_rate(base_currency, target_currency):
    url = f"https://api.exchangerate-api.com/v4/latest/{base_currency}"
    response = requests.get(url)
    data = response.json()
    rate = data["rates"].get(target_currency)

    if rate:
        return rate
    else:
        return None

def convert_currency(amount, base_currency, target_currency):
    rate = get_exchange_rate(base_currency, target_currency)
    if rate:
        return amount * rate
    else:
        print(f"Невозможно конвертировать {base_currency} в {target_currency}")

display_available_currencies()

amount = float(input("Введите сумму: "))
base_currency = input("Из какой валюты? (например, USD): ").upper()
target_currency = input("В какую валюту конвертировать? (например, RUB): ").upper()

converted_amount = convert_currency(amount, base_currency, target_currency)

if converted_amount:
    print(f"{amount} {base_currency} = {converted_amount:.2f} {target_currency}")


Результат в ролике: https://www.tiktok.com/t/ZTFudeKQa/
👍7
🔸 Прикольная игра на python

Исходный код:

import curses
import random
import time

stdscr = curses.initscr()
curses.curs_set(0)
sh, sw = stdscr.getmaxyx()
w = curses.newwin(sh, sw, 0, 0)
w.keypad(1)
w.timeout(100)

cat_x = sw // 2
cat_y = sh - 1
fish_x = random.randint(1, sw - 1)
fish_y = 0
score = 0

while True:
    w.clear()
    w.border(0)
    w.addstr(cat_y, cat_x, "😺")
    w.addstr(fish_y, fish_x, "🐟")
    w.addstr(0, 2, f"Score: {score}")

    key = w.getch()
    if key == curses.KEY_LEFT and cat_x > 1:
        cat_x -= 1
    elif key == curses.KEY_RIGHT and cat_x < sw - 2:
        cat_x += 1

    fish_y += 1
    if fish_y == sh:
        fish_y = 0
        fish_x = random.randint(1, sw - 1)

    if fish_y == cat_y and fish_x == cat_x:
        score += 1
        fish_y = 0
        fish_x = random.randint(1, sw - 1)

    w.refresh()
    time.sleep(0.1)

curses.endwin()
👍411