Skip to content

Commit

Permalink
Fixes readme
Browse files Browse the repository at this point in the history
  • Loading branch information
robertogallea committed Dec 15, 2020
1 parent 5f7b313 commit 292487b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ use robertogallea\LaravelPython\Services\LaravelPython;
...
$service = new LaravelPython();
$result = $service->run('/path/to/script.py')
$result = $service->run('/path/to/script.py'):
$parameters = array('par1', 'par2'):
$result = $service->run('/path/to/script.py', $parameters):
```

2. Injecting from the ServiceContainer
Expand All @@ -33,14 +35,24 @@ 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):
}
```

3. Using the `Python` facade
```
$result = \Python::run('/path/to/script.py')
$parameters = array('par1', 'par2'):
$result = \Python::run'/path/to/script.py', $parameters):
```

4. Via command line with an artisan command
```
php artisan python:run /path/to/script.py "Some parameter"
```
Note that you can use an arbitrary number of parameters

### Issues, Questions and Pull Requests
You can report issues and ask questions in the [issues section](https://github.com/robertogallea/LaravelPython/issues). Please start your issue with ISSUE: and your question with QUESTION:

Expand Down

0 comments on commit 292487b

Please sign in to comment.