-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.py
More file actions
85 lines (63 loc) · 1.84 KB
/
Copy pathgui.py
File metadata and controls
85 lines (63 loc) · 1.84 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import requests
import bs4
from prettytable import PrettyTable
from tkinter import *
from tkinter import ttk
name = list()
code = list()
spo = list()
x = PrettyTable()
coder = list()
spojr = list()
total = list()
def call(q,p, u):
#print(p,q,u)
name.append(str(q))
code.append(str(p))
spo.append(str(u))
codechef(str(p))
spoj(str(u))
x = PrettyTable(["name", "codechef handle", "spoj handle", "codechef questions", "spoj questions"])
for i in range(0, len(name)):
x.add_row([name[i], code[i], spo[i], coder[i], spojr[i]])
print(x)
print("-------------")
def codechef(user):
p = "https://codechef.com/users/"
r = user
q = str(p) + str(r)
res = requests.get(q)
soup = bs4.BeautifulSoup(res.text, 'html.parser')
coder.append(len(soup.article.getText().split()) - 1)
return;
def spoj(user):
p = "https://spoj.com/users/"
r = user
q = p + r
res = requests.get(q)
soup = bs4.BeautifulSoup(res.text, 'html.parser')
spojr.append((int(soup.dd.getText())))
return;
#total.append(coder[i] + spojr[i])
root=Tk()
root.geometry("1380x768")
#root.resizable(0,0)
label_1=Label(root,text="username")
label_2=Label(root,text="codechef handle")
label_3=Label(root,text="spoj handle")
entry_1=Entry(root)
entry_2=Entry(root)
entry_3=Entry(root)
label_1.place(x=1150,y=300)
label_2.place(x=1150,y=345)
label_3.place(x=1150,y=390)
entry_1.place(x=1150,y=325)
entry_2.place(x=1150,y=370)
entry_3.place(x=1150,y=415)
button=Button(root,text="submit",fg="blue",activebackground="yellow",command=lambda:call(entry_1.get(),entry_2.get(),entry_3.get()))
button.place(x=1150,y=420)
imsge1=PhotoImage[file='C:\\Users\\Arnab\\Desktop\\attachments\\1.jpg']
label=ttk.Label(root,image=image1)
PhotoImage(file='C:\\Users\\Arnab\\Desktop\\attachments\\1.jpg')
label.place()
root.mainloop()