-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_gui.py
More file actions
executable file
·69 lines (60 loc) · 2.03 KB
/
app_gui.py
File metadata and controls
executable file
·69 lines (60 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import tkinter
import tkinter.ttk
import function
def CheckMail(EMAIL, PASSWORD):
try:
connect = function.mail_connection()
except:
root.title("Нет подключения к серверу IMAP")
raise ConnectionError("Нет подключения к серверу IMAP")
try:
connect = function.mail_auth(connect, EMAIL, PASSWORD)
except:
root.title("Неправильный email/пароль")
raise ConnectionError("Неправильный email/пароль")
email_uid_list = function.mail_fetch_all_uid(connect)
email_list = []
counter = 0
maximum = len(email_uid_list)
pbar1["maximum"] = maximum
for i in email_uid_list:
try:
counter += 1
email_list.append(function.mail_parseaddr(connect, i))
pbar1["value"] = counter
root.title("Проверенно: {} из {}".format(counter, maximum))
root.update()
except:
pass
unique_list = function.uniquelist(email_list)
result_list = function.checkbadwords(unique_list)
with open("{}.txt".format(EMAIL), 'w', encoding='utf-8') as f:
for i in result_list:
f.write(i + '\n')
root.title("Результат в папке с программой".format(EMAIL))
btn1["text"] = "Начать"
root.update()
def btn1_click():
btn1["text"] = "Идет поиск"
email = ent1.get()
password = ent2.get()
CheckMail(email, password)
root = tkinter.Tk()
root.title("email address parser")
root.geometry("400x150")
root.resizable(width=False, height=False)
lbl1 = tkinter.Label(text="Ваш email")
lbl1.pack()
ent1 = tkinter.Entry()
ent1.pack()
lbl2 = tkinter.Label(text="Ваш пароль")
lbl2.pack()
ent2 = tkinter.Entry(show="*")
ent2.pack()
pbar1 = tkinter.ttk.Progressbar(orient="horizontal", mode="determinate", length=200)
pbar1.pack()
btn1 = tkinter.Button(text="Начать", command=btn1_click)
btn1.pack()
root.mainloop()