Форум сайта python.su
name_of_numbers = {1: 'Первый', 2: 'Второй', 3: 'Третий', 4: 'Червертый', 5: 'Пятый', 6: 'Шестой', 7: 'Седьмой', 8: 'Восьмой', 9: 'Девятый', 10: 'Десятый', 11: 'Одиннадцатый', 12: 'Двенадцатый', 13: 'Тринадцатый', 14: 'Четырнадцатый', 15: 'Пятнадцатый', 16: 'Шестнадцатый', 17: 'Семнадцатый', 18: 'Восемнадцатый', 19: 'Девятнадцатый'} def get_dictionary() -> dict: database = dict() amount_of_orders = int(input('Количество заказов: ')) for number in range(1, amount_of_orders + 1): order = input(f'{name_of_numbers[number]} заказ: ').split() if order[0] in database: if order[1] in database[order[0]]: database[order[0]][order[1]] += int(order[2]) else: database[order[0]][order[1]] = order[2] else: database[order[0]] = dict({order[1]: int(order[2])}) return database dictionary_result = get_dictionary() for name in dictionary_result: print(f'\n{name}') for info in dictionary_result[name]: print(f'\t{info}')
import socket import socks import smtplib r = 'smtp.yandex.ru:465:XXXXXXX:XXXXXXXX' server, port, login, password = r.split(':') p = ['38.91.107.2:58397', '134.255.219.126:2016', '185.239.237.49:2016'] for ipp in p: try: ip, port = ipp.split(':') socks.setdefaultproxy(socks.SOCKS5, ip, int(port), True) socket.socket = socks.socksocket socks.wrapmodule(smtplib) if port == str(465): smtp = smtplib.SMTP_SSL(server, port, timeout=10) smtp.ehlo_or_helo_if_needed() else: smtp = smtplib.SMTP(server, port, timeout=10) smtp.ehlo_or_helo_if_needed() smtp.starttls() smtp.ehlo_or_helo_if_needed() req = smtp.login(login, password) print(f"Received {req!r}") except Exception as e: print(e) continue
from ctypes import * DLL = cdll.LoadLibrary('D103') print(DLL) DLL.dgauss_.argtypes = [POINTER(c_wchar_p),POINTER(c_int),POINTER(c_double), POINTER(c_double), POINTER(c_double)] DLL.dgauss_.restype = c_double DOBType = c_double input1 = DOBType(1.0) input2 = DOBType(2.0) input3= DOBType(0.0) order = c_wchar_p('f') num=c_int(1) rez= DLL.dgauss_(order,num,input1,input2, input3) print(' TEST PROGRAM D103 (DGAUSS)') print(rez)
from tkinter import * from decimal import * root = Tk() fr = Frame(root) fr_but = Frame(root) fr1 = Frame(root) def pr_nt(set): ent.insert(END,set) def stir(): ent.delete(0,END) ent = Entry(fr, text = ‘0’, width=15,justify=CENTER) b = Button(fr_but,width=1,height=1,text='1') b1 = Button(fr_but,width=1,height=1,text='2') b2 = Button(fr_but,width=1,height=1,text='3') b3 = Button(fr_but,width=1,height=1,text='4') b4 = Button(fr_but,width=1,height=1,text='5') b5 = Button(fr_but,width=1,height=1,text='6') b6 = Button(fr_but,width=1,height=1,text='7') b7 = Button(fr_but,width=1,height=1,text='8') b8 = Button(fr_but,width=1,height=1,text='9') b9 = Button(fr_but,width=1,height=1,text='0') b10 = Button(fr_but,width=1,height=1,text='/') b11 = Button(fr_but,width=1,height=1,text='*') b12 = Button(fr_but,width=1,height=1,text='-') b13 = Button(fr_but,width=1,height=1,text='+') b14 = Button(fr_but,width=1,height=1,text='=') b15 = Button(fr_but,width=1,height=1,text='C', command=stir) b.bind('<Button-1>', lambda event: pr_nt(1)) b1.bind('<Button-1>', lambda event: pr_nt(2)) b2.bind('<Button-1>', lambda event: pr_nt(3)) b3.bind('<Button-1>', lambda event: pr_nt(4)) b4.bind('<Button-1>', lambda event: pr_nt(5)) b5.bind('<Button-1>', lambda event: pr_nt(6)) b6.bind('<Button-1>', lambda event: pr_nt(7)) b7.bind('<Button-1>', lambda event: pr_nt(8)) b8.bind('<Button-1>', lambda event: pr_nt(9)) b9.bind('<Button-1>', lambda event: pr_nt(0)) b10.bind('<Button-1>') b11.bind('<Button-1>') b12.bind('<Button-1>') b13.bind('<Button-1>') b14.bind('<Button-1>') b15.bind('<Button-1>') fr.pack() ent.pack() fr_but.pack() b6.grid(row=0,column=0) b7.grid(row=0,column=1) b8.grid(row=0,column=2) b3.grid(row=1,column=0) b4.grid(row=1,column=1) b5.grid(row=1,column=2) b.grid(row=2,column=0) b1.grid(row=2,column=1) b2.grid(row=2,column=2) b9.grid(row=3,column=1) b10.grid(row=0,column=3) b11.grid(row=1,column=3) b12.grid(row=2,column=3) b13.grid(row=3,column=3) b14.grid(row=3,column=2) b15.grid(row=3,column=0) fr1.pack() root.mainloop()
from random import choice import requests as r import time s = r.Session() s.headers['authorization'] = input('Token: ') fname = 'msg.txt' with open(fname, encoding='utf-8') as fin: text = fin.read() chat_id = input('Input chat id: ') delay = int(input('Delay between messages in seconds: ')) total_sent = 0 while True: try: msg = text print(f'Sending message {msg}') _data = {'content': msg, 'tts': False} resp = s.post( f'https://discord.com/api/v9/channels/{chat_id}/messages', json=_data).json() msg_id = resp['id'] total_sent += 1 print(f'Message sent (Already {total_sent} in total).') print(f'Sleeping {delay} seconds') time.sleep(delay) except Exception as e: print(f'Some error: {e}') time.sleep(20)]
from tkinter import * from tkVideoPlayer import TkinterVideo num = 1 home = Tk() home.geometry("500x500+500+200") home.title("1 LVL") videoplayer = TkinterVideo(master=home, scaled=True) def print_key(event): global num args = event.keysym, event.keycode, event.char print("Знак: {}, Код: {}, Символ: {}".format(*args)) if event.keycode == 87: # KEY W if num != 10: num += 1 home.title(f"{num} LVL") play_video(num) elif event.keycode == 83: # KEY S if num != 1: num -= 1 home.title(f"{num} LVL") play_video(num) def play_video(num): videoplayer.load(f"UpGrow/{num}.mp4") videoplayer.pack(expand=True, fill="both") videoplayer.play() home.bind("<Key>", print_key) play_video(1) home.mainloop()
cap = cv2.VideoCapture('video.mp4') while(cap.isOpened()): ret, frame = cap.read() if ret == True: