Is it possible to create a plugin using Python in Craft 2? I've been searching and trying things for a few days now, but I feel like I'm spinning my wheels. I've got a Python script that reads in a .pptx file, and returns a Dictionary of slides. I've also tried returning different things from the Python script, even as simple as a Hello World string. 

For simplicity's sake, I just have this code in my onAfterInstall() method:

$output = shell_exec("import_ppt.py 'original.pptx' ");
    var_dump($output);
var_dump($output);


For the filepath, I've also tried ".realpath(dirname(__FILE__))."/ as well, to no avail. I always get a NULL return and a PHP warning about not being able to modify headers. 

Then, in my Python file, I have:

if __name__ == '__main__':
import sys
buildSlideshow(sys.argv[1])


buildSlideshow takes one argument, which is the filepath of the powerpoint file, and eventually returns the dictionary of slides and slide content.

I know that the error isn't in my Python code, as if I run it in shell I don't have any problems with it and get the result I want. So, my overall question is this:

Is what I'm trying to do a pipe dream, or am I just missing something major? I can't find any docs about CraftxPython, simply searching the word "Python" on this very site brought up no results, and when I tried looking up how to incorporate Python into a Craft 2 plugin, all I got was information on how to create a plugin for Python.
I think you're going to have a bad time if you attempt to do this. Probably a better way would be to use PHPPresentation to read in the .pptx files.

Integration is certainly possible between server-side languages, but you're going to have to jump through a good deal of hoops that you could more easily just avoid by writing your plugin in PHP.