【发布时间】:2016-07-22 06:09:18
【问题描述】:
我在 'routes.php' 旁边有一个 python 脚本,我想从 'routes.php' 文件中执行它。
当我使用 exec() 函数时,它无法正常工作。
所以,我试试file_exists():
Route::get('/py', function(){
if (file_exists( "new.py" ))
echo "succeed";
else
echo "failed";
});
它只返回失败,那么如何通过 exec 函数从 .py 文件中获取输出?
【问题讨论】:
-
new.py的路径是什么?
标签: php python laravel laravel-5 routing