📅  最后修改于: 2022-03-11 15:00:42.306000             🧑  作者: Mango
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.')