Re: Tkinter GUI Error

2014-01-14 Thread Lewis Wood
I cannot say how grateful I am to find such a community willing to help 3 Thanks to everyone posting, learned a lot of new stuff :) Never knew you could just bring a local var into a def block using global inside of the function. Again, thanks for taking your time to help out newbies to

Re: Tkinter GUI Error

2014-01-14 Thread Lewis Wood
Also anyone know how to create an entry box for Tkinter where you can only enter in 2 digits? -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter GUI Error

2014-01-14 Thread Christian Gollwitzer
Am 14.01.14 22:27, schrieb Lewis Wood: Also anyone know how to create an entry box for Tkinter where you can only enter in 2 digits? You must use a validator to achieve this. This is a more advanced topic though. A validator is a function that is called whenever the user keys something in -

Tkinter GUI Error

2014-01-13 Thread fluttershy363
Inside the function is where I am having the problem, I am trying to get it to delete the label so that it may then replace it with a shorter text. Here is the full code: from tkinter import * import random main = Tk() main.title(Crack the Code) def check1(): entry = entry1var.get()

Re: Tkinter GUI Error

2014-01-13 Thread Lewis Wood
Forgot to mention I am using Python 3.3.3 -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter GUI Error

2014-01-13 Thread Christian Gollwitzer
Am 13.01.14 19:49, schrieb fluttershy...@gmail.com: Inside the function is where I am having the problem, I am trying to get it to delete the label so that it may then replace it with a shorter text. Here is the full code: from tkinter import * import random main = Tk() main.title(Crack

Re: Tkinter GUI Error

2014-01-13 Thread Lewis Wood
When I try to use the labelent1.configure, it greets me with an error: AttributeError: 'NoneType' object has no attribute 'configure' I changed the labelent's to global. Don't suppose you know why? Also how would I go about using an object for the entire window. I am still a Novice at Tkinter

Re: Tkinter GUI Error

2014-01-13 Thread Peter Otten
fluttershy...@gmail.com wrote: Inside the function is where I am having the problem, I am trying to get it to delete the label so that it may then replace it with a shorter text. Here is the full code: def check1(): entry = entry1var.get() if entry == num1:

Re: Tkinter GUI Error

2014-01-13 Thread Rick Johnson
On Monday, January 13, 2014 12:49:07 PM UTC-6, Lewis Wood wrote: labelent1 = Label(main, text=Correct!,fg=green).grid(row = 0, column = 3) [snip] UnboundLocalError: local variable 'labelent1' referenced before assignment Observe the following interactive session and prepare to be

Re: Tkinter GUI Error

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 5:49 AM, fluttershy...@gmail.com wrote: entry = entry1var.get() if entry == num1: elif entry num1: elif entry num1: num1 =str(random.randint(10,99)) num2 =str(random.randint(10,99)) num3 =str(random.randint(10,99)) mastercode = num1+num2+num3 Be