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 time | |
def progress_bar(progress, total, bar_length=40): | |
filled_length = int(bar_length * progress // total) | |
bar = '█' * filled_length + '-' * (bar_length - filled_length) | |
percentage = progress / total * 100 | |
print(f'\rProgress: [{bar}] {percentage:.2f}%', end='', flush=True) | |
def simulate_process(total_time): | |
for t in range(total_time + 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
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 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 gtts import gTTS | |
import os | |
import subprocess | |
from subprocess import check_output | |
text = "Global warming is the long-term rise in the average temperature of the Earth’s climate system" | |
language = "en" | |
speech = gTTS(text=text, lang=language, slow=False) | |
speech.save("text.mp3") | |
os.system('nircmd mediaplay 10000 text.mp3') |
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 pyperclip | |
while True: | |
pyperclip.waitForNewPaste(666) | |
x = pyperclip.paste() | |
print(x) |
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
proxies = [] | |
for proxy in proxies: | |
response = requests.get(proxies=proxy) | |
if response.status_code == requests.codes['ok']: | |
break | |
response.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
import requests | |
url_change = 'https://openexchangerates.org/api/latest.json?app_id=565db73ce703480cb8d8849e32f32035' | |
r = requests.get(url_change) | |
r = r.json() | |
print(r["rates"]["CNY"]) |
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
while True: | |
r = requests.get(url1, headers=HEADERS, params=PARAMS, proxies=PROXY[pr_count]) | |
print(r.status_code) | |
if r.status_code == 429: | |
pr_count += 1 | |
r = requests.get(url1, headers=HEADERS, params=PARAMS, proxies=PROXY[pr_count]) | |
print(r.status_code) | |
pr_count = 0 | |
if r.status_code == 429: | |
time.sleep(120) |
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 time | |
error = 0 | |
while True: | |
time.sleep(1) | |
try: | |
if error == 0: | |
i = input("input good or bad if ") |
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
# war 1 | |
import socket | |
def scan_port(ip,port): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.settimeout(0.5) | |
try: | |
connect = sock.connect((ip,port)) | |
print('Port :',port,' its open.') | |
sock.close() |
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
start_parse_type = input("Select the type of gun to start parsing.\n\n" | |
"1 - all weapon\n" | |
"2 - Custom weapon\n" | |
"Please enter: ") | |
type_list = ['machinegun', 'smg', 'pistol', 'rifle', 'shotgun'] | |
parse_list = [] | |
if int(start_parse_type) == 1: | |
for i in type_list: | |
print(i) |
NewerOlder