You need to have Python installed.
http://www.activestate.com/activepython-3
After installing, open the Actions list in Reaper, you'll see header "ReaScript", press New/Load, browse to the .py file to add it to Actions list. Now you can use it like any other action.