I'm a bit new to both phidgets and python, but have recently thrown myself into it so I'll try at an answer....
The key process handling the change events of the input in the sample code is with the function interfaceKitInputChanged. That function was setup as an event handler in the main program code with:
Code: Select all
interfaceKit.setOnInputChangeHandler(interfaceKitInputChanged)
So if you setup the pyhton logging module by adding to the module imports near the top of the program:
and near the beginning of the main program code with something like...
Code: Select all
logging.basicConfig(filename='example.log',format='%(asctime)s %(message)s')
Then you should be able to add something like the following into the interfaceKitInputChanged function:
Code: Select all
logging.info( "Input %i: %s" % ( e.index, e.state))
Hope this helps....