online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#WEEK-5 Movie Ticket Booking from tkinter import Tk import sqlite3 root = Tk() root.title("MOVIE TICKET BOOKING") root.geometry('560x560') #Connections conn = sqlite3.connect("week6_.db") c = conn.cursor() c.execute("CREATE TABLE IF NOT EXISTS tableee(MovieID integer, PersonName text, MovieName text, Class integer, NumberTickets integer)") global ida_edi global name_edi global mname_edi global classs_edi ida=IntVar() name=StringVar() mname=StringVar() ida_edi=IntVar() name_edi=StringVar() mname_edi=StringVar() classs_edi=IntVar() noo_edi=IntVar() #Definitions def query(): conn=sqlite3.connect('week6_.db') c=conn.cursor() c.execute("SELECT *,oid FROM tableee") records=c.fetchall() #print(records) print_records='' for record in records: print_records += str(record) + "\n" query_label=Label(root,text=print_records) query_label.grid(row=10,column=1) conn.commit() conn.close() def update(): conn=sqlite3.connect('week6_.db') c=conn.cursor() record_id=sid.get() ida_edi=IntVar() name_edi=StringVar() mname_edi=StringVar() classs_edi=IntVar() noo_edi=IntVar() c.execute("""UPDATE tableee SET MovieID=:ida, PersonName=:name, MovieName=:mname, Class=:classs, NumberTickets=:noo WHERE oid=:oid""", { 'ida': ida_edi.get(), 'name': name_edi.get(), 'mname': mname_edi.get(), 'classs': classs_edi.get() }) conn.commit() conn.close() def edit(): editor = Tk() editor.title("UPDATE WINDOW") editor.geometry('400x400') conn=sqlite3.connect('week6_.db') c=conn.cursor() record_id=sid.get() c.execute("SELECT * FROM tableee WHERE oid = " + record_id) records=c.fetchall() conn.commit() conn.close() Label(editor,text="Movie ID").grid(row=0,column=0) Label(editor,text="Person Name").grid(row=1,column=0) Label(editor,text="Movie Name:").grid(row=2,column=0) Label(editor,text="Class").grid(row=3,column=0) #Enteries ida_edi=IntVar() name_edi=StringVar() mname_edi=StringVar() classs_edi=IntVar() noo_edi=IntVar() #global ida_edi #global name_edi #global mname_edi #global classs_edi #global noo_edi ida_edi=Entry(editor, textvariable=ida_edi) ida_edi.grid(row = 0, column = 1) name_edi=Entry(editor, textvariable=name_edi) name_edi.grid(row = 1, column = 1) mname_edi=Entry(editor, textvariable=mname_edi) mname_edi.grid(row = 2, column = 1) #RadioButtons classs_edi = IntVar() a = "A" b = "B" Radiobutton(editor, text = "A", variable = classs_edi, value = 1).grid(row = 3, column = 1) Radiobutton(editor, text = "B", variable = classs_edi, value = 2).grid(row = 3, column = 2) noo=IntVar() noo_edi=Scale( root, from_=3, to=10, variable=noo_edi, orient=HORIZONTAL) noo_edi.grid(row=4,column=1) Label(root,text="No. of Tickets").grid(row=4,column=0) for record in records: ida_edi.insert(0,record[0]) name_edi.insert(0,record[1]) mname_edi.insert(0,record[2]) upd=Button(editor,text="UPDATE RECORD",command=update) upd.grid(row=10,column=1,ipadx=50) def var_states(): print("7.15pm: %d,\n9.00pm: %d" %(var1.get(),var2.get())) label_4_edi=Label(editor,text="Time of Show") label_4_edi.grid(row=3,column=3) var1=IntVar() Checkbutton(editor, text="7.15 pm").grid(row=3,column=4) var2=IntVar() Checkbutton(editor,text="9.00 am").grid(row=3,column=5) v = DoubleVar() def insert(): conn=sqlite3.connect('week6_.db') c=conn.cursor() c.execute("insert into tableee values('"+str(ida.get())+"', '"+str(name.get())+"', '"+str(mname.get())+"', '"+str(classs.get())+"', '"+str(noo.get())+"')") conn.commit() conn.close() ida.delete(0,END) name.delete(0,END) mname.delete(0,END) #classs.delete(0,END) #noo.delete(0,END) def delete(): connection = sqlite3.connect("week6_.db") cur = connection.cursor() cur.execute("DELETE FROM tableee") connection.commit() connection.close() #Creating text box labels Label(root,text="Movie ID").grid(row=0,column=0) Label(root,text="Person Name").grid(row=1,column=0) Label(root,text="Movie Name:").grid(row=2,column=0) Label(root,text="Class").grid(row=3,column=0) #Enteries ida=Entry(root, textvariable=ida) ida.grid(row = 0, column = 1) name=Entry(root, textvariable=name) name.grid(row = 1, column = 1) mname=Entry(root, textvariable=mname) mname.grid(row = 2, column = 1) #RadioButtons classs = IntVar() a = "A" b = "B" Radiobutton(root, text = "A", variable = classs, value = 1).grid(row = 3, column = 1) Radiobutton(root, text = "B", variable = classs, value = 2).grid(row = 3, column = 2) b1=Button(root,text='Insert',width=5,command=insert).grid(row=5,column=0) b2=Button(root,text='Delete',width=5,command=delete).grid(row=6,column=0) b3=Button(root,text='Update',width=5,command=edit).grid(row=5,column=1) b4=Button(root,text='Select',width=5,command=query).grid(row=6,column=1) sid_l=Label(root, text='Select ID') sid_l.grid(row=100,column=0) sid=Entry(root, width=30) sid.grid(row=100,column=1) def var_states(): print("7.15pm: %d,\n9.00pm: %d" %(var1.get(),var2.get())) label_4=Label(root,text="Time of Show") label_4.grid(row=3,column=3) var1=IntVar() Checkbutton(root, text="7.15 pm").grid(row=3,column=4) var2=IntVar() Checkbutton(root,text="9.00 am").grid(row=3,column=5) v = DoubleVar() noo=IntVar() noo=Scale( root, from_=3, to=10, variable=noo, orient=HORIZONTAL) noo.grid(row=4,column=1) Label(root,text="No. of Tickets").grid(row=4,column=0) conn.commit() conn.close() root.mainloop() #RA1911033010120

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue