Calling a Python code in Moodle Plugin and displaying output

Re: Calling a Python code in Moodle Plugin and displaying output

by Aécio Fernandes -
Number of replies: 0
Yes, I have. 
It worked the same way shell_exec(), the only "type" of output it provides is related to simple "print" functions.
I took a look at the documentation beforehand and noticed it gathers the output as an array, where each item is a line from the output. Since I couldn't output anything besides simple prints, I tried parsing it into a simple table, with no luck printing "\n" chars.

Regarding trying to output a graph or even a static image, I tried using pipes, which provided me no output when trying to display the item with the child's output (array[1], if I remember correctly).

Simple prints of the arrays (from exec(), shell_exec(), proc_open(), etc) appear to work fine, anything other than that doesn't.