The specific error is:
_getandcreate() missing 5 required positional arguments: '_get_userpass', '_createuser', 't', 'username', and 'password'
Problematic subroutine:
def create_regwindow(self):
t = tk.Toplevel(self)
t.wm_title("Register")
t.entry_user = tk.Entry(t)
t.entry_pass = tk.Entry(t, show="*")
t.title = tk.Label(t, text="Enter your new username and password below")
t.field_user = tk.Label(t, text="Username")
t.field_pass = tk.Label(t, text="Password")
t.regbutton = tk.Button(t, text="Create Account", command=self._getandcreate) <-- HERE
t.title.grid(row=0, sticky=tk.E)
t.title.grid(row=0, column=1)
t.field_user.grid(row=1, sticky=tk.E)
t.field_pass.grid(row=2, sticky=tk.E)
t.entry_user.grid(row=1, column=1)
t.entry_pass.grid(row=2, column=1)
t.regbutton.grid(row=3, column=1)
And the actual subroutine here:
def _getandcreate(self, _get_userpass, _createuser, t, username, password):
_get_userpass(t)
_createuser(username, password)
I need them variables to be passed into the command in the first block of code (labelled HERE), however, when I do this, I need to put these variables into a part of my code higher up (within init, whole code at bottom) - causing the issue of them not being defined.
I'm slightly confused. The purpose is, when the user clicks "Create Account", the data the user entered is taken and added to my database.