📜  streamlit 加载文件 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:42.306000             🧑  作者: Mango

代码示例2
import streamlit as st
import os

filename = st.text_input('Enter a file path:')
try:
    with open(filename) as input:
        st.text(input.read())
except FileNotFoundError:
    st.error('File not found.')