[Tutor] returning from 2 functions at once

Alan Gauld learn2program at gmail.com
Sat Oct 9 13:51:30 EDT 2021


CCing to tutor.

Please use replyAll when respo ding to tutor list mails.


On 09/10/2021 15:13, Ed Connell wrote:
>
> Actually I am trying to learn to work with tkinter but I don't think
> y'all do tkinter.  Is there a list for that?
>
There is a dedicated tkinter list but since its part of the standard
library we cover the basics here too.

If its complicated stuff the tkinter list is better.


> def pickFromList(( thelist ):
>     stuff...
>     return choice
>
> I can do that easily in Python, but I want to use the ttk.Listbox( ... 
>
I can't find any reference to a ttk.Listbox widget. There is however a
tkinter Listbox
so I'll assume you mean ghat.

As I'm sure you know tkinter is event driven so a function like the
above only makes
sense when we know which events you are attaching it to? For example the
tkinter.Listbox
widget often has the mouse button actions bound to events and these
often call the curselection()
method to get the list of currently selected items (or their indices at
least.) 

But you need to explain with a bit more detail what exactly you are
trying to do.
Its not obvious.

> -- 

Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list