so the following doesnt work as i understand it because functions have local variables s the nbr=0 is a different variable with the same name.
so how do i get around this?
Code:
from __future__ import division
import Tkinter
from Tkinter import *
mygui = Tkinter.Tk()
mygui.title("Calculator")
w = Label(mygui, text="Calc this if you can!")
w.pack()
nbr=0
def Calc(nstr):
nbr = nbr + 1
print "You need to seek help!",nbr
b = Button(mygui, text="1",command=lambda n=1:Calc(n))
b.pack()
mygui.mainloop()