$command = 'ls -1 | wc -l'; $output = exec($command); echo "Total number of files in directory: {$output}";
$command = 'python /path/to/my_script.py'; $output = exec($command); echo "Output from script: {$output}";In this example, the Python script "my_script.py" is executed using the PHP function exec(). The output of the Python script is stored in the $output variable, which is then displayed on the web page. The package library that contains the hook exec function is the PHP standard library. This is a built-in library that comes with PHP and does not require any additional installation.