Search code examples
pythonpython-3.xtkintertkinter-entry

Python Tkinter not working. Name error


Really simple code, but not working using tkinder in Python.

This code has been copied just as seen in a video tutorial, so I think it could be any config:

from tkinter import*

root=Tk()

miFrame=Frame(root, width=500, height=400)

miFrame=pack()

Label(miFrame, text="Hola alumnos de Python", fg="red", font=("Comic Sans 
MS", 18)).place(x=100, y=200)

root.mainloop()

The error:

Traceback (most recent call last): File "Prueba2.py", line 7, in miFrame=pack() NameError: name 'pack' is not defined


Solution

  • Replace miFrame=pack() with miFrame.pack()