Большое Спасибо за поддержку:
ЛолКек MR
Vlad Optimist
Реквизиты для поддержки:
DonationAlerts - донат
5536914076566912 – Номер карты Тинькофф
5469980422015392 – Номер карты Сбербанк
Всем хорошего дня/вечера и хороших выходных! :)
ЛолКек MR
Vlad Optimist
Реквизиты для поддержки:
DonationAlerts - донат
5536914076566912 – Номер карты Тинькофф
5469980422015392 – Номер карты Сбербанк
Всем хорошего дня/вечера и хороших выходных! :)
👍8
#Расшифровкахэшаmd5СПомощьюPython
Код из видео:
import hashlib
input_hashed = input('Введите хэшированный пароль: ')
password_file = open('passwords.txt', 'r')
try:
for word in password_file:
encoding_word = word.encode('utf-8')
hashed_word = hashlib.md5(encoding_word.strip())
digesting = hashed_word.hexdigest()
if digesting == input_hashed:
print('Искомый пароль: ', word)
password_file.close()
break
except:
print('Пароль не найден.')
password_file.close()
Код из видео:
import hashlib
input_hashed = input('Введите хэшированный пароль: ')
password_file = open('passwords.txt', 'r')
try:
for word in password_file:
encoding_word = word.encode('utf-8')
hashed_word = hashlib.md5(encoding_word.strip())
digesting = hashed_word.hexdigest()
if digesting == input_hashed:
print('Искомый пароль: ', word)
password_file.close()
break
except:
print('Пароль не найден.')
password_file.close()
👍10🤯1
Файл с паролями нормально не скидывается. Попробую завтра нормально скинуть, сегодня не получается :(
#ДобавлениеИзображенияПоСсылкеВTkinterPython
Код из видео:
from tkinter import *
import requests
from io import BytesIO
from PIL import Image, ImageTk
url = ''
def load_image():
response = requests.get(url)
if response.status_code != 200:
label['text'] = 'Изображение не найдено' + str(response.status_code)
else:
image = ImageTk.PhotoImage(Image.open(BytesIO(response.content)).resize((500, 500), Image.ANTIALIAS))
label.config(image=image)
label.image = image
root = Tk()
root.geometry('500x500')
root.resizable(0, 0)
Button(root, text='Показать картинку', command=load_image).pack()
label = Label(root)
label.pack()
root.mainloop()
Код из видео:
from tkinter import *
import requests
from io import BytesIO
from PIL import Image, ImageTk
url = ''
def load_image():
response = requests.get(url)
if response.status_code != 200:
label['text'] = 'Изображение не найдено' + str(response.status_code)
else:
image = ImageTk.PhotoImage(Image.open(BytesIO(response.content)).resize((500, 500), Image.ANTIALIAS))
label.config(image=image)
label.image = image
root = Tk()
root.geometry('500x500')
root.resizable(0, 0)
Button(root, text='Показать картинку', command=load_image).pack()
label = Label(root)
label.pack()
root.mainloop()
👍6
Видео вышло немного в другом формате, нежели обычно, хотел бы узнать у вас, продолжать озвучивать действия за кадром, или же делать как раньше и писать код вместе со зрителем?
Anonymous Poll
58%
Новый формат лучше
42%
Старый формат лучше
#СозданиеКонтекстногоМенюВTkinterPython
Код из видео:
from tkinter import *
def circle():
c.create_oval(x, y, x + 30, y + 30)
def square():
c.create_rectangle(x, y, x + 30, y + 30)
def popup(event):
global x, y
x = event.x
y = event.y
menu.post(event.x_root, event.y_root)
x = 0
y = 0
root = Tk()
c = Canvas(root, width=300, height=300, bg='white')
c.pack()
c.bind('<Button-3>', popup)
menu = Menu(tearoff=0)
menu.add_command(label='Круга', command=circle)
menu.add_command(label='Квадрат', command=square)
root.mainloop()
Код из видео:
from tkinter import *
def circle():
c.create_oval(x, y, x + 30, y + 30)
def square():
c.create_rectangle(x, y, x + 30, y + 30)
def popup(event):
global x, y
x = event.x
y = event.y
menu.post(event.x_root, event.y_root)
x = 0
y = 0
root = Tk()
c = Canvas(root, width=300, height=300, bg='white')
c.pack()
c.bind('<Button-3>', popup)
menu = Menu(tearoff=0)
menu.add_command(label='Круга', command=circle)
menu.add_command(label='Квадрат', command=square)
root.mainloop()
👍12