如何使用python在streamlit应用程序中打开atoti链接?

Posted

技术标签:

【中文标题】如何使用python在streamlit应用程序中打开atoti链接?【英文标题】:How to open atoti link in streamlit application with python? 【发布时间】:2021-11-17 12:35:22 【问题描述】:

我正在尝试在 streamlit 应用程序中运行 atoti 链接,我想在其中使用 atoti 创建一些图。 我尝试了下面的代码,但它显示了其他内容来代替链接。

new = pd.DataFrame()
new['Link'] = [session.link()]
st.dataframe(new)
st.write(new.to_html(escape=False, index=False), unsafe_allow_html=True)

输出是

     Link
    
 0   Link(_path='', _session=<atoti.session.Session object at 0x000002B700293FA0>)

后跟:

Link

Link(_path='', _session=)

预期的链接是http://localhost:53533

谁能帮我解决这个问题?

【问题讨论】:

【参考方案1】:

如文档中的here 所述,Session.link() 仅在 JupyterLab 中可用。

你可以使用f"http://localhost:session.port"

It's also possible to always use the same port.

【讨论】:

以上是关于如何使用python在streamlit应用程序中打开atoti链接?的主要内容,如果未能解决你的问题,请参考以下文章