Re: Problem exiting from a script using tkinter

2020-11-25 Thread Paulo da Silva
Às 22:44 de 21/11/20, Chris Angelico escreveu: > On Sun, Nov 22, 2020 at 9:36 AM Paulo da Silva > wrote: >> >> Às 22:18 de 21/11/20, Chris Angelico escreveu: >>> On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva >>> wrote: Hi! Why this does not work?! from tkinter impor

Re: Problem exiting from a script using tkinter

2020-11-21 Thread Chris Angelico
On Sun, Nov 22, 2020 at 9:36 AM Paulo da Silva wrote: > > Às 22:18 de 21/11/20, Chris Angelico escreveu: > > On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva > > wrote: > >> > >> Hi! > >> > >> Why this does not work?! > >> > >> from tkinter import * > >> > >> def terminate(root): > >> root.quit

Re: Problem exiting from a script using tkinter

2020-11-21 Thread Paulo da Silva
Às 22:18 de 21/11/20, Chris Angelico escreveu: > On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva > wrote: >> >> Hi! >> >> Why this does not work?! >> >> from tkinter import * >> >> def terminate(root): >> root.quit >> > > Is root.quit a function? Simply referencing a function's name does not >

Re: Problem exiting from a script using tkinter

2020-11-21 Thread Chris Angelico
On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva wrote: > > Hi! > > Why this does not work?! > > from tkinter import * > > def terminate(root): > root.quit > Is root.quit a function? Simply referencing a function's name does not call it (because functions are first-class objects - you can put a

Problem exiting from a script using tkinter

2020-11-21 Thread Paulo da Silva
Hi! Why this does not work?! from tkinter import * def terminate(root): root.quit root=Tk() #b=Button(root,text="QUIT",command=root.quit) b=Button(root,text="QUIT",command=lambda: terminate(root)) b.pack() mainloop() Thanks -- https://mail.python.org/mailman/listinfo/python-list