Skip to content Skip to sidebar Skip to footer

Can I Call Python Script Or Function From Php

I have the php page which lists the backups with filename and username. the backups are done with python script but for web interface I used php. Now I want to put the facility on

Solution 1:

Yes you can call exec("python pythonscript.py someparams"); or if you need to save the output to a variable use this code

exec("python mypythonscript.py someparams",$output);
var_dump($output);

More informaiton: call python script by php and solve errors

Solution 2:

You can call the shell from PHP:

and there are more.

Post a Comment for "Can I Call Python Script Or Function From Php"