diff --git a/main.py b/main.py index 47ed94f09bb60be2860aaea26673d36eb74fa824..543c0eeaa9d0cf0668215e2e6140eef1b11d6a60 100644 --- a/main.py +++ b/main.py @@ -18,3 +18,21 @@ content = response.read().decode('utf-8') # (4)打印数据 print(content) +import streamlit as st + +# 创建一个标题 +st.title('My First Streamlit App') + +# 创建一个文本框并接收用户输入 +user_input = st.text_input('Enter your name') + +# 判断用户是否有输入,并输出一句问候语 +if user_input != '': + st.write('Hello,', user_input, '!') +else: + st.write('Please enter your name.') + +import subprocess + +subprocess.run(["streamlit", "run", "main.py"]) +