-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront_query.py
41 lines (36 loc) · 1.01 KB
/
front_query.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import streamlit as st
import pandas as pd
from database import queryy
def front_query():
col1, col2 = st.columns(2)
l=[]
with col1:
c1 = st.text_input("c1:")
c2 = st.text_input("c2:")
c3 = st.text_input("c3:")
c4 = st.text_input("c4:")
with col2:
c5 = st.text_input("c5:")
c6 = st.text_input("c6:")
c7 = st.text_input("c7:")
c8 = st.text_input("c8:")
query = st.text_input("query:")
if c1!='':
l.append(c1)
if c2!='':
l.append(c2)
if c3!='':
l.append(c3)
if c4!='':
l.append(c4)
if c5!='':
l.append(c5)
if c6!='':
l.append(c6)
if c7!='':
l.append(c7)
if c8!='':
l.append(c8)
if st.button('calc'):
df = pd.DataFrame(queryy(query), columns=l)
st.dataframe(df)