A Mountain of Perl Books + Python Advocacy
Fredrik Lundh
effbot at telia.com
Mon May 8 12:30:21 EDT 2000
tony summerfelt wrote:
> i think something like the following is pretty hard to beat:
cannot tell what that one's doing without running it,
and I don't have perl on this box...
...but the next one is easier:
> and i think the following is hard to beat in tcl/tk:
>
> #!/usr/bin/wish
>
> button .b -text "Exit" -command {exit}
> pack .b
it can be written in 2-3 lines in Python as well, but
the pydiomatic Python version isn't much longer:
#!/usr/bin/env python
from Tkinter import *
import sys
b = Button(text="Exit", command=sys.exit)
b.pack()
mainloop()
</F>
<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->
More information about the Python-list
mailing list