返回给定Streamlit配置选项的当前值。

在终端中运行 streamlit config show 以查看所有可用选项。

函数签名[source]

st.get_option(key)

参数

key (str)

配置选项键,格式为"section.optionName"。要查看所有可用的选项,请在终端中运行streamlit config show

示例

import streamlit as st

color = st.get_option("theme.primaryColor")
forum

还有问题吗?

我们的 论坛 充满了有用的信息和Streamlit专家。