[pygtk] Key event handling and Pythons lake of switch statement

Christian Mallwitz c.mallwitz at gmail.com
Mon Jan 28 04:24:57 WST 2013


Hi guys,

Where in C you would have something along the lines of:

 switch (event->keyval) {
   case GDK_Left: ...
   case GDK_BackSpace: ...
   ...
}

What is your preferred code style to handle that in Python? How about
more than one keyval triggering the same action?

Thanks
Christian


More information about the pygtk mailing list