i'm trying to pass one variable between 2 functions, but i don't understand where i'm wrong, because it doesn't work. here's my python3 script:
from tkinter import *
w1=Tk()
w2=Tk()
def go(which):
print(which)
b=Button(w2,text='print',command=lambda:go(which.get()))
b.pack()
w2.withdraw()
def main(which):
w2.deiconify()
b1=Button(w1,text='button 1',command=lambda:main('button 1'))
b1.pack()
b2=Button(w1,text='button 2',command=lambda:main('button 2'))
b2.pack()
w1.mainloop()
thanks