Hi, I have a problem with trying to start the program before it started fine and towards my login and such but now I get this error:
<pre>Traceback (most recent call last):
File "/Users/tomas/Downloads/RegistroDeTienda/main.py", line 115, in <module>
user = x["name"]
NameError: name 'x' is not defined. Did you mean: 'X'?
[Finished in 519ms with exit code 1]
what could be due? I have this
conex3 = pymysql.connect(host='mysql-5706.dinaserver.com',
user='myadmin',
password='Fideo123.',
database='python',
charset='utf8mb4',
cursorclass=pymysql.cursors.DictCursor)
cur3 = conex3.cursor()
verificarName = "SELECT * FROM clientes WHERE id = 1"
verificarPassword = "SELECT password FROM clientes WHERE id = 1"
cur3.execute(verificarName)
myresult = cur3.fetchall()
row6 = [item['name'] for item in myresult]
print (row6)
for x in myresult:
print (x["name"])
root = Tk()
root.title("Mostrar datos")
root.geometry("400x400")
imagen1=PhotoImage(file="logo2.png")
label1 = Label(root, image=imagen1)
label1.place(x=93, y=0)
x_ventana = root.winfo_screenwidth() // 2 - 300 // 2
y_ventana = root.winfo_screenheight() // 2 - 300 // 2
posicion = str(300) + "x" + str(300) + "+" + str(x_ventana) + "+" + str(y_ventana)
root.geometry(posicion)
root.resizable(0,0)
user = x["name"]
password = x["password"]
ttk.Label(text="Usuario:").place(x=50, y=110)
ttk.Label(text="Contraseña:").place(x=50, y=165)
v1 = StringVar()
e1 = Entry(root, textvariable=v1, justify=CENTER)
e1.place(x=50, y=130, width=200, height=30)
v2 = StringVar()
e2 = Entry(root, textvariable=v2, show="*", justify=CENTER)
e2.place(x=50, y=185, width=200, height=30)
and more code but to simplify, this is where the error is thrown: user = x["name"]
Any additional information would be greatly appreciated
What I have tried:
<pre>Any additional information would be greatly appreciated