Tkinter error when trying to get StringVar


Im trying to gget used to tkinter on python and when I try to set a StringVar into an entry i just get the following error.

File "", line 53, in Pswlog
    username_entry = tk.Entry(root,stringvarialbe=psw2)
  File "", line 3101, in __init__
    Widget.__init__(self, master, 'entry', cnf, kw)
  File "", line 2628, in __init__
_tkinter.TclError: unknown option "-stringvarialbe"

This is the part of the code where I use tkinter.

 root = tk.Tk()
        root.resizable(0, 0)

        psw = tk.StringVar(root)
        psw2 = tk.StringVar(root)

        root.columnconfigure(0, weight=1)
        root.columnconfigure(1, weight=3)

        username_label = tk.Label(root, text="contraseƱa:")
        username_label.grid(column=0, row=0, sticky=tk.W, padx=5, pady=5)

        username_entry = tk.Entry(root, textvariable=psw)
        username_entry.grid(column=1, row=0, sticky=tk.E, padx=5, pady=5)
        username_label = tk.Label(root, text="Repita la contraseƱa:")
        username_label.grid(column=0, row=1, sticky=tk.W, padx=5, pady=5)

        username_entry = tk.Entry(root,stringvarialbe=psw2)
        username_entry.grid(column=1, row=1, sticky=tk.E, padx=5, pady=5)

        login_button = tk.Button(root, text="Register")
        login_button.grid(column=1, row=3, sticky=tk.E, padx=5, pady=5)
Asked By: ShadowSPM



Typo error.

Change this:

username_entry = tk.Entry(root,stringvarialbe=psw2)


username_entry = tk.Entry(root, textvariable=psw2)
Answered By: toyota Supra
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.