<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Python R在API开发中的集成方案]]></title><description><![CDATA[<p dir="auto">R本身的Web开发能力较弱 可以有以下几个方案来集成python和R：<br />
1.用python、flask开发API  在python中用rpy2调R  这种方式R的输出得用python进行解析  而且在web的后台多进程模式下可能有问题 见:<a href="https://stackoverflow.com/questions/63785478/multithreaded-flask-application-causes-stack-error-in-rpy2-r-process" rel="nofollow ugc">https://stackoverflow.com/questions/63785478/multithreaded-flask-application-causes-stack-error-in-rpy2-r-process</a><br />
这种方式本质是在python里面运行了一个R环境 问题被复杂化了。</p>
<p dir="auto">2.用python\flask、R plumber各自开发自己的服务<br />
这种方式比较清晰 python也直接可以调用R的API  对于没有API化的R包 可以用plumber进行适当的改造</p>
]]></description><link>http://an.forum.genostack.com/topic/764/python-r在api开发中的集成方案</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 12:31:59 GMT</lastBuildDate><atom:link href="http://an.forum.genostack.com/topic/764.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Sep 2022 07:04:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Python R在API开发中的集成方案 on Thu, 15 Sep 2022 07:40:35 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://medium.com/swlh/python-developers-celery-is-a-must-learn-technology-heres-how-to-get-started-578f5d63fab3" rel="nofollow ugc">https://medium.com/swlh/python-developers-celery-is-a-must-learn-technology-heres-how-to-get-started-578f5d63fab3</a><br />
<img src="/assets/uploads/files/1663227120577-52a3ec13-d7f3-42d7-8528-3cb5102f509c-image.png" alt="52a3ec13-d7f3-42d7-8528-3cb5102f509c-image.png" class=" img-responsive img-markdown" /><br />
也可以用队列的方式<br />
<a href="https://github.com/lecardozo/rworker" rel="nofollow ugc">https://github.com/lecardozo/rworker</a></p>
<p dir="auto">这种方式对于R的计算量比较大时 可以考虑</p>
]]></description><link>http://an.forum.genostack.com/post/1839</link><guid isPermaLink="true">http://an.forum.genostack.com/post/1839</guid><dc:creator><![CDATA[anneng]]></dc:creator><pubDate>Thu, 15 Sep 2022 07:40:35 GMT</pubDate></item></channel></rss>