If you pass in the event when you enter a callback, you can look at event.type to determine which button was pushed and process the action accordingly. Make sure to check the event.type first for a button press as not all events will define an event.button.
You don’t need to install an RPM package just to get to the files. This can be especially useful if you’re looking for the default configuration files or docs from a package. You may have the package already installed and don’t want to reinstall it. It’s not pretty, and I wish rpm and yum provided a prettier method of extracting a file, but it works.
If you want to check for syntax errors without actually running your code, you can compile it with py_compile. You may want to do this if your code modifies files or interacts with the network or external hardware or applications.