PHP code example of robertogallea / laravel-python

1. Go to this page and download the library: Download robertogallea/laravel-python library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

robertogallea / laravel-python example snippets


use robertogallea\LaravelPython\Services\LaravelPython;
...
public function __construct(LaravelPython $service)
{
  $result = $service->run('/path/to/script.py');
  $parameters = array('par1', 'par2');
  $result = $service->run('/path/to/script.py', $parameters);
}