Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 21ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
f

file-upload

Recently created Least recently created Recently updated Least recently updated

timmy / 使用 Streamlit 建立文件內容查看器

Last active 6 hours ago automation file-upload markdown python streamlit text-processing ui

此程式使用 Streamlit 讓使用者上傳文字或 Markdown 檔案,顯示其內容,並透過暫存檔處理,可應用於文件檢視與內容處理工具。

0 0 0 1
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 # 如果有文件被上傳