- Posts: 26
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
$command = escapeshellcmd('python myScript.py'); $output = shell_exec($command); //$output2 = shell_exec($command); $arr = json_decode($output); var_dump ($arr)
#!/usr/bin/env python import json print (json.dumps([[1,2,3], [2,4,6]]));
I am not a Python expert, but you need to have some kind of python interpreter installed for the server to understand and execute it, right? It sounds weird to just paste a Python script into a PHP page and it runs. I don't think it usually works this way.I know, but when I tried the same python script ,that worked on a regular php page,on limesurvey , It did'nt display anything.
Same for me, maybe we made error , but i think server parse PHP or Python. But not puyton inside PHP …holch wrote:
I am not a Python expert, but you need to have some kind of python interpreter installed for the server to understand and execute it, right? It sounds weird to just paste a Python script into a PHP page and it runs. I don't think it usually works this way.I know, but when I tried the same python script ,that worked on a regular php page,on limesurvey , It did'nt display anything.