Is it possible to call a python script or function from php

I have a php page that lists backups with file name and username. backups are done using a python script, but for the web interface I used php.

Now I want to place the object on a web page where there will be a button called recovery next to the backup file name, and all the contents of the home directory will be replaced.

I can make a python function with parameters like backup file name, username and restore the backup.

But I don't know how to pass variables in python via php

+3
source share
2 answers

exec("python pythonscript.py someparams");, ,

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

: python script php

+5

All Articles