Answers for "call python script from php"

PHP
1

php run python script

$r=shell_exec("python3 mypythonscript.py"); 
echo $r;//will be out put of .py script
Posted by: Guest on February-12-2021
1

php import python script

#excute python file named test.py

<?php
    $command = escapeshellcmd('python test.py');
    $output = shell_exec($command);
    echo $output;
?>
Posted by: Guest on April-27-2022

Code answers related to "call python script from php"

Browse Popular Code Answers by Language