0
from tkinter import*
import tkinter
import sqlite3
import sys
conn = sqlite3.connect('REVISION CARD.db')
c=conn.cursor()

def load():
    root=Tk()
    root.title("REVION CARDS")
    root.geometry("700x400+100+100")
    w1=Label(root, text="Question")
    w1.pack()
    e=Entry(root,width=40)
    e.pack()
    w2=Label(root,text="Answer")
    w2.pack()
    e1=Entry(root,width=40)
    e1.pack()
    toolbar=Frame(root)
    navbar=Frame(root)
    N=Button(toolbar, text="next",width=9,command=getNext)
    N.pack(side=RIGHT, padx=200, pady=5)
    B=Button(toolbar, text="previous", width=9)
    B.pack(padx=100, pady=5)
    toolbar.pack(side=TOP, fill=X)
    count=IntVar()
    c.execute("SELECT * FROM topic")
    list1 = c.fetchall()
    buttons=[i for i in range(10)]
    for num in buttons:
        btn=tkinter.Button(navbar, text=num)#command=
        btn.pack(side=tkinter.TOP)
    navbar.pack(side=RIGHT, fill=X)
    global list1
    global e
    global e1
    global count

def getNext():
    try:
        e.delete(0, END)
        e1.delete(0, END)
        e.insert(0, list1[count.get()][1])
        e1.insert(0, list1[count.get()][2])
        count.set(count.get()+1)
    except IndexError:
        #root.destroy()
        e.insert(0, "NULL")
        e1.insert(0, "NULL")

#***************************************************** THE MENU ***************************************************
root =Tk()
root.title("REVION CARDS")
root.geometry("700x400+100+100")
w1=Label(root, text="REVISION CARDS",fg="red", font=("Comic Sans", 16))
w1.pack()

toolbar=Frame(root)

test_topic=Button(toolbar, text="Test on topic",font=("Comic Sans", 12),bg="red")
test_topic.pack(side=BOTTOM, padx=2,pady=30)

load=Button(toolbar, text="Load Revision Cards from a topic",font=("Comic Sans", 12),bg="green",command=load)
load.pack(side=BOTTOM, padx=2,pady=40)

create_new=Button(toolbar, text="Create New Revision Cards for a topic",font=("Comic Sans", 12),bg="orange")
create_new.pack(side=TOP, padx=2,pady=50)

toolbar.pack(side=TOP,fill=X)
2
Contributors
1
Reply
8
Views
3 Months
Discussion Span
Last Post by woooee
0

You have two root=Tk() statements which Tkinter does not like. Also you don't have a mainloop(). And I have no idea what you want to do or why this program was posted here.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.