Map Key to run Function

Is there a way to map a key to run a certain file? I already have Keymap Editor addon but I am trying to see how to push a button to run a custom python file.

I found that the id of the key is 61575 but now I am trying to figure out how to map key 61575 to run RunScript("/home/osmc/.kodi/userdata/switch.py")

I found gen.xml in my /userdata/keymaps folder and i added <key id="61575">RunScript("/home/osmc/.kodi/userdata/switch.py")</key> to it but it did not do anything

See my reply in the kodi.tv forum for RPi
Derek

I replied on the kodi.tv forum but i thought I would also post here.

So I turned on debugging and pushed the delete button and it turns out the action is being invoked. But for some reason I do not have the desired output. Is there a way to have my python script output to the debugging file so I can add some print statements or something?

Here is a snippet of my log: http://pastebin.com/VcFGL17M