tkinter what do you use?

vegaseat at yahoo.com vegaseat at yahoo.com
Fri Mar 2 19:27:24 CET 2007


On Mar 2, 8:32 am, "Eric Brunel" <eric_bru... at despammed.com> wrote:
> On Fri, 02 Mar 2007 16:17:32 +0100, Gigs_ <g... at hi.t-com.hr> wrote:
> > list = Listbox()
> > list.insert('end', x)
> > list.insert(END, x)
>
> > what do you use 'end' or END?
> >>> from Tkinter import END
> >>> END == 'end'
>
> True
>
> So this isn't really important... My personal usage varies: for your use  
> case, I tend to use the symbolic constant (END); for sticky options in  
> grids, I tend to use the strings ('nswe' is shorter than N+S+W+E, not to  
> mention tk.N+tk.S+tk.W+tk.E).
> --
> python -c "print ''.join([chr(154 - ord(c)) for c in  
> 'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"

When you use other modules like PIL with Tkinter, it is best to give
Tkinter a namespace.  This way you keep track where things are coming
from.  I prefer 'import Tkinter as tk' then it is much simpler to use
'end' or 'nswe'.  Otherwise you have to use tk.END or God forbit tk.N
+tk.S+tk.W+tk.E -- see what I mean?




More information about the Python-list mailing list