class Example(tk.Frame):
def __init__(self, parent):
global p
p = 1.1
....
def looper(self):
if self.keys['Prior']:
p = p -.01
self.draw()
This code comes back with UnboundLocalError: local variable 'p' referenced before assignment
I tried putting global p/p=1.1 down in the main routine outside of the Class and I got the same exact error. Somewhere I must be misunderstanding things. I thought global meant through the whole program...which is the way I want it...set it once and let it go throughout the program. What am I doing wrong?