-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile3.py
51 lines (37 loc) · 1.25 KB
/
file3.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
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 22 20:32:48 2018
@author: ADITYA
"""
from tkinter import *
import sqlite3
def sel():
pr=str(var1.get())
#pr=pr.lower()
st=str(var2.get())
#st=st.lower()
#print(pr+" "+st)
query='''SELECT * FROM course, details WHERE provider="'''+pr+'''" AND category="'''+st+'''"'''
conn = sqlite3.connect('onlineCourses.db')
c = conn.cursor()
c.execute(query)
data=c.fetchall()
print(data)
root = Tk()
frame1 = Frame(root, highlightbackground="green", highlightcolor="green",width=500, height=500, bg="blue")
frame1.pack()
frame2 = Frame(root, highlightbackground="red", highlightcolor="red",width=500, height=500, bg="red")
frame2.pack()
providers=['Udemy','Udacity','Coursera']
var1 = StringVar()
for provider in providers:
radio1 = Radiobutton(frame1, text=provider, variable=var1 ,value=provider,command=sel)
radio1.pack(side=TOP)
var1.set("Udemy")
streams=['Data Science','Blockchain','Development']
var2 = StringVar()
for stream in streams:
radio2 = Radiobutton(frame2 ,text=stream, variable=var2 ,value=stream,command=sel)
radio2.pack(side=TOP)
var2.set("Data Science")
root.mainloop()