Essentially ODI doesn't support Python directly but there are a couple of things you can do. The things to consider are:
- where you need to run the code
- what you want the code to do
- how integrated into ODI do you need it to be
Jython
ODI does support Jython which is a Java implementation of Python. This can be embedded within procedures and Knowledge Modules which allows you to (relatively) easily make use of the ODI metadata. It isn't particularly friendly to code or debug but is functional and powerful, you get access to ODI logging etc.
Whilst this is possible I would look to do this is Groovy rather than Jython as it is much cleaner and simpler
Shell Script
If your python script is already there and is completely stand alone you can use an OdiOsCommand inside of a package. You would need an agent installed on the box on which you want to run the script and you can just do something like
python /path/mypythonscript.py
just as you would from the command line.
This is simple enough but the integration into ODI is very limited. It will handle errors just like a shell script (so handled exceptions will be swallowed and lost) and any parameters you want to pass will need to be via the command line.