【问题标题】:How can I send (request.post) pandas dataframe/json to my raspberry-pi webserver?如何将(request.post)pandas dataframe/json 发送到我的 raspberry-pi 网络服务器?
【发布时间】:2021-08-27 10:52:18
【问题描述】:

我正在寻找指南/视频、建议和技巧,以了解如何从 python 获取数据帧/json 数据,然后通过 html/php 在我的树莓派上将其部署到一个简单的表上,该表作为我的本地网络上的网络服务器。任何帮助将不胜感激,因为我已经尝试了几个小时。

【问题讨论】:

  • 服务器使用的是哪个框架?
  • 我在 pi 上设置了 apache2

标签: python html pandas raspberry-pi webserver


【解决方案1】:

我对 apache 没有任何经验,但使用 df.to_html() 方法让您的数据框显示为网页非常简单。

with open("dataframe.html", "w+") as f:
    html = df.to_html()
    f.write(html)

现在,如果您在本地打开 dataframe.html,您将在浏览器中看到您的数据框。

如何部署是另一回事——看起来需要启用 python。 This link should get you started...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-03
    • 1970-01-01
    相关资源
    最近更新 更多