-
Notifications
You must be signed in to change notification settings - Fork 1
/
gui.py
57 lines (43 loc) · 1 KB
/
gui.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
import Tkinter
from Tkinter import *
import tkMessageBox
import datetime
from pymongo import MongoClient
client = MongoClient()
db = client.news_articles
top = Tkinter.Tk()
def openit():
a = E1.get()
b = int(E2.get())
c = int(E3.get())
d = int(E4.get())
date1 = datetime.date(d, c, b)
for post in db.cnn.find({"url": a}):
print post['content']
for post in db.et.find({"url": a}):
print post
for post in db.ys.find({"url": a}):
print post
for post in db.ycomb.find({"url": a}):
print post
top.title("almabase")
top.geometry("400x200")
B = Tkinter.Button(top,text="submit",command=openit)
B.grid(row=8,column=1)
L1 = Label(top, text="Article Name")
E1 = Entry(top, bd =5)
L2 = Label(top, text="date")
E2 = Entry(top, bd =5)
L3 = Label(top, text="month")
E3 = Entry(top, bd =5)
L4 = Label(top, text="year")
E4 = Entry(top, bd =5)
L1.grid(row=1)
L2.grid(row=2)
L3.grid(row=3)
L4.grid(row=4)
E1.grid(row=1,column=1)
E2.grid(row=2,column=1)
E3.grid(row=3,column=1)
E4.grid(row=4,column=1)
top.mainloop()