Q:

Invalid literal for base int10

When running a Tkinter Python program, I keep getting this error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python34\lib\tkinter\__init__.py", line 1533, in __call__
 return self.func(*args)
 File ".\tkintertesting2.py", line 18, in trylogin
if int(Password) == passcode:
ValueError: invalid literal for int() with base 10: ''

The code basically takes two inputs from the user and compares them to see if they are valid credentials. Currently, It prints that any value is wrong and gives the error listed above:
import tkinter

def trylogin():
    global wxy
    global s
    IDnumberz = s
    Password = wxy
    allowed_Usernames = [13702,1234,2]
    allowed_PassCode = [8702,8535,1212]
    for username in allowed_Usernames:
        if int(IDnumberz) == username:
            correct_username = 1
            print ("good0")
            break
        else:
            correct_username = 0
            print (IDnumberz)
    for passcode in allowed_PassCode:
        if int(Password) == passcode:
            correct_password = 1
            print ("good1")
            break
        else:
            correct_password = 0
            print (Password)
    if correct_password == 1 and correct_username == 1:
        print ("Access granted. Welcome back!")
    else:
        print ("Uh oh! Something with your login was wrong!")

window = tkinter.Tk() #Create Window
window.title("AutoChange v1.3") #Rename window
window.geometry("600x600")
window.wm_iconbitmap('favicon.ico')
photo = tkinter.PhotoImage(file= "logo.gif")
photopacker = tkinter.Label(window, image=photo)
window.configure(background="#a1dbcd")

usernamelabel = tkinter.Label(window, text="Username", bg="#a1dbcd", )
usernamenter = tkinter.Entry(window,)
IDnumber = tkinter.IntVar()
s = IDnumber.get()

passwordlabel = tkinter.Label(window, text="Password", bg="#a1dbcd")
wxy = tkinter.IntVar()
passwordenter = tkinter.Entry(window, textvariable=wxy)
password = tkinter.StringVar()
wxy = password.get()

loginbutton = tkinter.Button(window, text="Login", bg="#a1dbcd",
                             command=trylogin)

#PACK
photopacker.pack()
usernamelabel.pack()
usernamenter.pack()
passwordlabel.pack()
passwordenter.pack()
loginbutton.pack()
window.mainloop() #Start Window

A:

I'm going to disagree with the other answerers who've said that your issue has nothing to do with tkinter. It does, a little bit.
The core issue is that you're not reading the user ID and password fields from your GUI when you press the the "Login" button. Rather, you're accessing the s and wxy variables that hold values that at one time may have belonged to those fields, but probably don't any more by the time you press the button.
Actually s reads the initial value from your global variable IDnumber (an IntVar). That IDnumber isn't actually hooked up to anything though, so I suspect it will always be zero. wxy is initially an IntVar itself, and hooked in the the GUI, but it is later overwritten with a value fetched from from the password variable (a TextVar). So it's probably always an empty string.
The first thing to fix is reading the values from your Entry fields properly.
I suggest the following, though there are probably other ways to do more or less the same thing (e.g. using TextVars, or not using variable wrappers at all and just calling get on the Entrys themselves, and doing the integer conversion yourself):
usernamelabel = tkinter.Label(window, text="Username", bg="#a1dbcd", )
IDnumber = tkinter.IntVar()
usernamenter = tkinter.Entry(window, textvariable=IDnumber)

passwordlabel = tkinter.Label(window, text="Password", bg="#a1dbcd")
password = tkinter.IntVar()
passwordenter = tkinter.Entry(window, textvariable=password)

No get calls happen at this point! They go in the trylogin function:
def trylogin():
    id_num = IDnumber.get()
    password_num = password.get()
    # ...

You don't need a global statement to access global variables (only if you want to assign new values to them).
This will work, assuming your user puts in an integer value in both Entry boxes. If they don't however (including if they leave one or both boxes empty), you'll get an exception again, because IntVar.get calls int on the value it has been set to (which will always be a string, internally). So, you probably want to wrap your get calls in try/except blocks and do something when the value is no good. I'm not sure what an appropriate reaction would be in your program, so I'll leave the details up to you. Here's the general structure:
def trylogin():
    try:
        id_num = IDnumber.get()
    except ValueError:
        print("invalid user ID") # replace this with some GUI error reporting?
        return

    try:
        password_num = password.get()
    except:
        print("invalid password (must be an integer)")
        return

    # ...

I suspect there are other issues with the logic in your code, but I'll stop here, as I think this addresses the exception you're getting in your current code.

