timmy / Streamlit 超連結

0 Lajky
0 Forky
1 Soubory
Naposledy aktivní 10 months ago
此範例展示如何在 Streamlit 應用中使用 st.markdown 搭配 unsafe_allow_html=True 來插入 HTML 連結,使使用者能夠點擊超連結並在新視窗開啟指定網站。
1 import streamlit as st
2
3 st.markdown(
4 '<a href="https://www.example.com" target="_blank">點擊這裡瀏覽範例網站</a>',
5 unsafe_allow_html=True
6 )

timmy / Streamlit 使用者驗證系統

0 Lajky
0 Forky
1 Soubory
Naposledy aktivní 10 months ago
此應用程式使用 streamlit_authenticator 進行使用者登入、登出及密碼重設,並支援 YAML 和 JSON 兩種格式作為驗證資料存儲。適用於需要帳戶管理的 Streamlit Web 應用,確保只有授權使用者可以存取內容。
1 import json
2 from abc import ABC, abstractmethod
3
4 import streamlit as st
5 import streamlit_authenticator as stauth
6 import yaml
7
8
9 # 策略介面
10 class DataHandlerStrategy(ABC):
Novější Starší