Click here to Skip to main content
16,004,653 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Traceback (most recent call last):
File "C:\Users\kartik\Desktop\MY SQL GUI.py", line 78, in <module>
    label6=tkinter.Label(root, test='Selece Co', width=20)
  File "C:\Users\kartik\AppData\Local\Programs\Python\Python38\lib\tkinter\__init__.py", line 3143, in __init__
    Widget.__init__(self, master, 'label', cnf, kw)
  File "C:\Users\kartik\AppData\Local\Programs\Python\Python38\lib\tkinter\__init__.py", line 2567, in __init__
    self.tk.call(
_tkinter.TclError: unknown option "-test"


What I have tried:

Python
import tkinter
from tkinter import *


import mysql.connector

top=tkinter.Tk()

root = Tk()
root.geometry('500x500')
root.title('REGISTRATION FORM')


fullname = StringVar()
email = StringVar()
var = IntVar()
c = StringVar()
var1 = IntVar()


def db () :
    name1 = fullname.get()
    Email = email.get()
    Gender = var.get()
    Country = c.get()
    prog = var1.get()
    conn = mysql.connector.connect(host = 'localhost',
                                   user = 'root',
                                   password = 'tiger',
                                   database = 'REGISTER')
    cur=conn.cursor()
    cur.execute("INSERT INTO FORM VALUES ('{}','{}','{}','{}','{}')").format(name1,Email,Gender,Country,prog)
    cur.execute('oommit')
    
label1 = tkinter.Label(root, text = 'REGISTRATION FORM' , width = 20)
label1.place(x=90,y=53)


label2 = tkinter.Label(root, text='Full Name',width=20)
label2.place(x=80,y=130)


entry1=tkinter.Entry(root,textvar=fullname)
entry1.place(x=240,y=130)


label3= tkinter.Label(root, text="Enter Email ID",width=20)
label3.place(x=68,y=180)


entry2= tkinter.Entry(root,textvar=email)
entry2.place(x=240,y=180)

label4= tkinter.Label(root,text='Gender',width=20)
label4.place(x=70,y=230)


radio1= tkinter.Radiobutton(root, text="Male",padx = 5, variable=var, value=1)
radio1.place(x=235,y=230)


radio2= tkinter.Radiobutton(root, text="Female",padx = 20, variable=var, value=2)
radio2.place(x=290,y=230)


label5= tkinter.Label(root, text='Country',width=20)
label5.place(x=70,y=280)


l1=['Canada','India','USA','Ireland','UK','South Korea'];


drop1=tkinter.OptionMenu(root , c , *l1 )
drop1.config(width=15)
c.set('  SELECT COUNTRY  ')
drop1.place(x=240,y=280)

label6=tkinter.Label(root, test='Selece Co', width=20)
label6.place(x=85,y=330)


var2=IntVar()


chek1=tkinter.Checkbutton(root, text='JAVA', variable=var1)
chek1.place(x=235,y=330)


chek2=tkinter.Checkbutton(root, text='PYTHON', variable=var2)
chek2.place(x=290,y=330)


button1=tkinter.button(root, text = 'Submit',width=20,command=db)
button1.place(x=180,y=380)

root.mainloop()
Posted
Updated 25-Jun-20 7:42am
v2
Comments
ZurdoDev 25-Jun-20 13:25pm    
What is your question?
Patrice T 25-Jun-20 13:28pm    
What help ?
What is the problem/question ?

1 solution

I suspect a typo in line

label6=tkinter.Label(root, test='Selece Co', width=20)


:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900