I'm experiencing some problems with my code.. I want my code to popup a messagebox if the value is not in between 0-255, but it's not working. I'm just using c>255 to troubleshoot right now but I don't know what the problem seems to be. Even though its if c>255, it still displays the messagebox when the value is under 255. Can someone tell me what I'm doing wrong :\
def clicked_wbbalance(self):
self.top = Toplevel()
self.top.title("LASKJDF...")
Label(self.top, text="Enter low level").grid(row=0, column=0,padx=10)
Label(self.top, text="Enter high level").grid(row=1, column=0,padx=10)
Label(self.top, text="Values must be between 0 to 255").grid(row=3, column=0)
self.a = Entry(self.top)
self.b = Entry(self.top)
self.a.grid(row=0, column=1,padx=10)
self.b.grid(row=1, column=1,padx=10)
Button(self.top, text="Ok", command=self.get).grid(row=3, column = 1)
def get(self):
self.c = self.a.get()
self.d = self.b.get()
if self.c > 255:
tkMessageBox.showerror("Error", "Please enter a value between 0-255")
self.clicked_wbbalance()
else:
print "asdfasd"