方法 1:streamlit run your_script.py [-- script args]
方法 2:streamlit run https://raw.githubusercontent.com/streamlit/demo-uber-nyc-pickups/master/streamlit_app.py
方法 3:python -m streamlit run your_script.py
方法 4:streamlit run your_script.py
import sys
import streamlit as st
from streamlit import runtime
from streamlit.web import cli as stcli
def my_web_app():
# markdown
st.markdown(‘Streamlit markdown’)
st.header(‘Streamlit Demo’)
def main():
if runtime.exists():
my_web_app()
else:
sys.argv = [“streamlit”, “run”, sys.argv[0]]
sys.exit(stcli.main())
if name == ‘main’:
main()
Convert an existing app into a multipage app将现有应用转换为多页应用
Create the entrypoint file创建入口点文件
Create multiple pages?创建多个页面
Run the multipage app运行多页应用
Next steps?后续步骤
知识库
Connect to data sources?连接到数据源
Deploy Streamlit apps?部署 Streamlit 应用程序
Session State basics?会话状态底子知识
Build a basic LLM chat app构建根本的 LLM 聊天应用程序
Build an LLM app using LangChain利用 LangChain 构建 LLM 应用程序
利用 Streamlit
Sanity checks?健全性查抄
Batch elements and input widgets with?st.form批处置惩罚元素和输入小部件?st.form
How do I run my Streamlit script?怎样运行我的 Streamlit 脚本?
How can I make Streamlit watch for changes in other modules I’m importing in my app?怎样让 Streamlit 监督我在应用程序中导入的其他模块的变化?
What browsers does Streamlit support?Streamlit支持哪些浏览器?
What is the path of Streamlit’s?config.toml?file?Streamlit?config.toml?的文件路径是什么?
Where does st.file_uploader store uploaded files and when do they get deleted?st.file_uploader将上传的文件存储在哪里,何时删除?
How do you retrieve the filename of a file uploaded with st.file_uploader?怎样检索利用 st.file_uploader 上传的文件的文件名?
[How to remove “· Streamlit” from the app title?怎样删除“·Streamlit“从应用程序标题?](https://docs.streamlit.io/knowledge-base/using-streamlit/remove-streamlit-app-title “How to remove “· Streamlit” from the app title怎样删除“·Streamlit“从应用程序标题?”)
How to download a file in Streamlit?怎样在 Streamlit 中下载文件?
How to download a Pandas DataFrame as a CSV?怎样将 Pandas DataFrame 下载为 CSV?
How do I get dataframe row-selections from a user?怎样从用户那里获取数据帧行选择?
How can I make?st.pydeck_chart?use custom Mapbox styles?怎样利用?st.pydeck_chart?自定义 Mapbox 样式?
How to insert elements out of order?怎样无序插入元素?
How to animate elements?怎样为元素制作动画?
Append data to a table or chart将数据追加到表格或图表
How do I upgrade to the latest version of Streamlit?怎样升级到最新版本的 Streamlit?
Widget updating for every second input when using session state利用会话状态时每秒更新一次小组件
How do I create an anchor link?怎样创建锚链接?
How do I enable camera access?怎样启用相机访问?
Why does Streamlit restrict nested?st.columns?为什么 Streamlit 限定嵌套?st.columns??
How to host static files in Streamlit?怎样在Streamlit中托管静态文件?