tonius/python

Tonius | Python :: 一个提供灵活性的包,旨在在PHP和Laravel项目中平滑运行简单和复杂的Python脚本。

2.0.1 2020-05-24 00:44 UTC

This package is auto-updated.

Last update: 2024-09-27 00:44:46 UTC


README

================================================================================

Version Build Status Total Downloads StyleCI License Monthly Downloads composer.lock

Tonius Python :: 一个旨在在PHP和Laravel项目中平滑运行简单和复杂Python脚本的包。当我们需要执行基于系统的操作,同时希望将结果用于我们的PHP应用程序时,这非常有用。感谢Symfony基金会

安装

通过Composer

$ composer require tonius/python

使用方法

您必须已安装Python。

use tonius\python\Facades\Python;
$response = Python::run($fileName);

可用选项:

$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 ]);

变更日志

请参阅变更日志获取最近更改的更多信息。

测试

$ ./vendor/bin/phpunit

贡献

请参阅contributing.md以获取详细信息和一个待办事项列表。

安全性

如果您发现任何安全相关的问题,请通过电子邮件olubunmivictor6@gmail.com联系,而不是使用问题跟踪器。

鸣谢

许可证

MIT。有关更多信息,请参阅许可证文件