codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem exiting from a script using tkinter


On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva
<p_d_a_s_i_l_v_a_ns at nonetnoaddress.pt> 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
function in a variable or pass it as a parameter etc). In order to
make it do its work, you have to call it.

ChrisA