asdd
Browse files- dataup/backup.csv +2 -1
- pages/❄️p2.py +21 -12
dataup/backup.csv
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
message,slider_val,checkbox_val,datetime
|
2 |
-
|
|
|
|
1 |
message,slider_val,checkbox_val,datetime
|
2 |
+
cool11232,42,False,2022-07-26 15:03:12.283643
|
3 |
+
stupod,42,False,2022-07-26 15:03:12.283643
|
pages/❄️p2.py
CHANGED
@@ -7,8 +7,17 @@ st.markdown("# Page 2 ❄️")
|
|
7 |
st.sidebar.markdown("# Page 2 ❄️")
|
8 |
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
|
|
|
|
|
12 |
|
13 |
with st.form("input form"):
|
14 |
message = st.text_input("user_name")
|
@@ -24,7 +33,7 @@ with st.form("input form"):
|
|
24 |
df = pd.DataFrame(
|
25 |
{
|
26 |
'message': message,
|
27 |
-
'slider_val':slider_val,
|
28 |
'checkbox_val': checkbox_val,
|
29 |
'datetime': dt
|
30 |
},
|
@@ -38,22 +47,22 @@ with st.form("input form"):
|
|
38 |
st.table(df)
|
39 |
df.to_csv('./dataup/backup.csv', index = None, encoding = 'utf_8_sig')
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
with st.container():
|
50 |
bt = st.button("truncate table?")
|
|
|
|
|
51 |
if bt:
|
52 |
st.balloons()
|
53 |
pd.DataFrame({
|
54 |
'message': 'message',
|
55 |
-
'slider_val':
|
56 |
-
'checkbox_val':
|
57 |
'datetime': dt
|
58 |
},
|
59 |
index=range(1)).\
|
|
|
7 |
st.sidebar.markdown("# Page 2 ❄️")
|
8 |
|
9 |
|
10 |
+
with st.container():
|
11 |
+
with st.form("query form"):
|
12 |
+
submitted = st.form_submit_button("show history")
|
13 |
+
if submitted:
|
14 |
+
df = pd.read_csv('./dataup/backup.csv')
|
15 |
+
st.table(df)
|
16 |
+
|
17 |
|
18 |
+
placeholder = st.empty()
|
19 |
+
with placeholder.container():
|
20 |
+
st.markdown('---')
|
21 |
|
22 |
with st.form("input form"):
|
23 |
message = st.text_input("user_name")
|
|
|
33 |
df = pd.DataFrame(
|
34 |
{
|
35 |
'message': message,
|
36 |
+
'slider_val': slider_val,
|
37 |
'checkbox_val': checkbox_val,
|
38 |
'datetime': dt
|
39 |
},
|
|
|
47 |
st.table(df)
|
48 |
df.to_csv('./dataup/backup.csv', index = None, encoding = 'utf_8_sig')
|
49 |
|
50 |
+
|
51 |
+
placeholder = st.empty()
|
52 |
+
with placeholder.container():
|
53 |
+
st.markdown('---')
|
54 |
+
|
55 |
+
|
|
|
|
|
56 |
with st.container():
|
57 |
bt = st.button("truncate table?")
|
58 |
+
# for i in range(100):
|
59 |
+
# st.progress(i)
|
60 |
if bt:
|
61 |
st.balloons()
|
62 |
pd.DataFrame({
|
63 |
'message': 'message',
|
64 |
+
'slider_val': 0,
|
65 |
+
'checkbox_val': True,
|
66 |
'datetime': dt
|
67 |
},
|
68 |
index=range(1)).\
|