You can't create a StringVar
unless a Tk
object has already been initialized.
Move your login_window
line so that it appears before the other assignments:
login_window=tkinter.Tk()
usr_login = StringVar()
pwd_login = StringVar()
Also, usr_login
won't be visible in login
, so you'll get a NameError
. make it global, or consider putting both login_gui
and login
in a class, so they can access common attributes through self
.