PHP code example of tonius / python

1. Go to this page and download the library: Download tonius/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/ */

    

tonius / python example snippets


$options = [
    'test' => true, // To run a default test script if filename is not passes
    'output' => 'json', // Output types : json, file, raw. it's raw by default
    'fileName' => 'example.json' // .txt, php, e.t.c If you specify output to be file, you must pass the name of file to dump the output
];

use tonius\python\Facades\Python;
$response = Python::run(null, ['test' => true ]);