简体   繁体   English

如何将 python 代码的输出从 jupyter notebook 导入到 php?

[英]How to import the output of python code from jupyter notebook to php?

I am building a recommendation system for a web page.我正在为网页构建推荐系统。 The recommendation system is built using Python in Jupyter Notebook.推荐系统是在 Jupyter Notebook 中使用 Python 构建的。 I want to transfer this output to my web page (built using PHP).我想将此输出传输到我的网页(使用 PHP 构建)。 How can it be done so that my project works as expected?如何才能使我的项目按预期工作?

I tried to import the CSV file to MySQL, but it failed.我尝试将 CSV 文件导入 MySQL,但失败了。

One possible way is to embed the Python code in an AWS Lambda function with an API gateway in order to create a REST API for the function.一种可能的方法是将 Python 代码嵌入到带有 API 网关的 AWS Lambda 函数中,以便为该函数创建 REST API。

Then you can make a POST request from your PHP page to the endpoint.然后,您可以从 PHP 页面向端点发出 POST 请求。

See guideline here .请参阅此处的指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM