I am new to python and trying program for the following. I have a code snippet which outputs the label position to the shell. I wanted to hide the label or make them invisible. But still wanted to obtain the output, even if I click without seeing them.
I wrote some code, but it stays visible.
My coding:
import Tkinter
root = Tkinter.Tk()
def unshow_me(event):
event.widget.grid_forget()
def handle_click(text):
print text
a=text
for r in range(3):
for c in range(6):
text = 'R=%s,C=%s'%(r,c)
label = Tkinter.Label(root, text=text, borderwidth=1 )
label.grid(row=r,column=c)
label.bind("<Button-1>", lambda e, text=text:handle_click(text),unshow_me)
root.mainloop()
Please help me to rectify the problem!