All gists matching topic streamlit

最後活躍 10 months ago
此程式使用 Streamlit 讓使用者上傳文字或 Markdown 檔案,顯示其內容,並透過暫存檔處理,可應用於文件檢視與內容處理工具。
1 import streamlit as st
2 import os
3
4 # 標題
5 st.title("文件內容查看器")
6
7 # 文件上傳
8 uploaded_file = st.file_uploader("請上傳文字或 Markdown 文件", type=["txt", "md"])
9
10 # 如果有文件被上傳
最後活躍 10 months ago
這段程式碼使用 Streamlit 和 streamlit-authenticator 來 管理使用者登入,透過 YAML 設定檔 儲存使用者憑證與 Cookie 配置,並提供 登入、登出 和 使用者驗證 功能。
1 cookie:
2 expiry_days: 30
3 key: some_signature_key
4 name: my_auth_cookie
5 credentials:
6 usernames:
7 jsmith:
8 email: jsmith@gmail.com
9 failed_login_attempts: 0 # Will be managed automatically
10 logged_in: False # Will be managed automatically
上一頁 下一頁