-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblogboard.py
63 lines (45 loc) · 1.56 KB
/
blogboard.py
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
from tkinter import *
import sqlite3
from flask import Flask
app = Flask(__name__)
@app.route("/")
@app.route("/EmailBucket")
def root_build():
root = Tk()
root.title("{Lawplug}")
root.geometry("500x500")
root.iconbitmap("C:/Users/emeka/Downloads/lawplugfavicon.ico")
conn = sqlite3.connect("Newsletter_Email_Locker.db")
cur = conn.cursor()
# cur.execute("CREATE TABLE email_List(emails TEXT)")
emeka_txt = Label(root, text="EmailBucket" , fg='purple' )
emeka_txt.pack()
copyright_txt = Label(root, text='copy right ✒ 2021', fg='purple')
copyright_txt.pack(side='bottom')
# entry variable
e = Entry(root, foreground='purple', width=50)
e.pack()
# label text
l = Label(root, text="enter your email to get our newsletters" , fg='purple')
l.pack()
# update database with insert
def insert_db():
global get_list
e.get()
cur.execute("INSERT INTO email_List VALUES (?)", ' ')
get_list = e.get()
print(get_list)
mssg_word= Label(root, text='email saved successfully, check email for newsletters', fg='blue')
mssg_word.pack()
conn.commit()
x = e.clipboard_clear()
print(x)
#update button
update_button = Button(root, text ="Submit email!", fg="purple", bg="white", width=15, command=insert_db)
update_button.pack()
# commit to memory in database
conn.commit()
# conn.close()
root.mainloop()
if __name__ == '__main__':
app.run()