Skip to content Skip to sidebar Skip to footer

Typeerror: Grid_configure() Missing 1 Required Positional Argument: 'self'

prompt = '>>' from tkinter import * root = Tk() userName = Entry() myLabel = Label(root, text='UserName') userName.grid(row=0) myLabel = Label.grid(row=0, column=1) root.ma

Solution 1:

This statement is incorrect:

myLabel = Label.grid(row=0, column=1)

At the very least it needs to be this:

myLabel = Label().grid(row=0, column=1)

Though, if you want mayLabel to be anything other than None you need to use two lines:

myLabel = Label()
myLabel.grid(row=0, column=1)

Though, if you want to use the previous definition of myLabel, maybe you need to simply omit myLabel = Label(), since that creates a new empty label.

Post a Comment for "Typeerror: Grid_configure() Missing 1 Required Positional Argument: 'self'"