- Posts: 10
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How can I run Python scripts using limesurvey?
- hagerregah
- Topic Author
- Offline
- New Member
Less
More
3 years 5 months ago #206550
by hagerregah
How can I run Python scripts using limesurvey? was created by hagerregah
I have a few python scripts I want to run. I added a few lines in Limesurvey's plugin code:
and this is the python script:
However nothing is displayed in the plugin page.
Any help?
thank you.
Code:
$command = escapeshellcmd('python myScript.py'); $output = shell_exec($command); //$output2 = shell_exec($command); $arr = json_decode($output); var_dump ($arr)
and this is the python script:
Code:
#!/usr/bin/env python import json print (json.dumps([[1,2,3], [2,4,6]]));
However nothing is displayed in the plugin page.
Any help?
thank you.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11757
- Thank you received: 2753
3 years 5 months ago #206586
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic How can I run Python scripts using limesurvey?
You are aware that Limesurvey runs on PHP, right?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- hagerregah
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
3 years 5 months ago #206611
by hagerregah
Replied by hagerregah on topic How can I run Python scripts using limesurvey?
I know, but when I tried the same python script ,that worked on a regular php page,on limesurvey , It did'nt display anything.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11757
- Thank you received: 2753
3 years 5 months ago #206661
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic How can I run Python scripts using limesurvey?
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.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 5 months ago #206694
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic How can I run Python scripts using limesurvey?
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.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.