try create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
# 标题
|
4 |
+
st.title("欢迎使用Streamlit应用程序")
|
5 |
+
|
6 |
+
# 文本输入框
|
7 |
+
name = st.text_input("请输入您的姓名")
|
8 |
+
|
9 |
+
# 按钮
|
10 |
+
button_clicked = st.button("点击这里")
|
11 |
+
|
12 |
+
# 根据按钮点击状态展示消息
|
13 |
+
if button_clicked:
|
14 |
+
st.write(f"你好,{name}!欢迎使用Streamlit应用程序。")
|
15 |
+
|
16 |
+
# 图片
|
17 |
+
st.image("https://www.streamlit.io/images/brand/streamlit-logo-primary-colormark-darktext.png",
|
18 |
+
caption="Streamlit Logo", use_column_width=True)
|