Excerpt |
---|
I usually use shell_exec when I need to run python code. The benefit of shell_exec is returning the result as string, so I can use it for other purpose. |
The below is the example to create graph by python, and display as a result in php.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?php
$locale = 'ko_KR.UTF-8';
setlocale(LC_ALL, $locale);
putenv('LC_ALL='.$locale);
echo shell_exec("python matplot_test.py");
?> |
...