I have this on my code:
conn = st.experimental_connection('mysql', type='sql')
df = conn.query('SELECT * from cameras where protocolo="rtsp";', ttl=600)
mteste = ('oi', 'papai', 'xii')
mteste = "("
linhas = ""
for row in df.itertuples():
linhas += f"'{row.nome}'"
mteste = mteste + linhas + '"")'
print(list(linhas))
print("\n\n")
print(mteste)
option = st.sidebar.selectbox('Escolha uma câmera do sistema?',list(mteste))
st.sidebar.write('Câmera selecionada:', option)
And only returns this:
[“'”, ‘t’, ‘e’, ‘s’, ‘t’, ‘e’, ‘1’, ‘2’, ‘3’, “'”, “'”, ‘v’, ‘i’, ‘p’, ‘-’, ‘3’, ‘2’, ‘3’, ‘0’, ‘-’, ‘B’, ‘-’, ‘S’, ‘L’, ‘-’, ‘G’, ‘2’, “'”, “'”, ‘I’, ‘C’, ‘5’, ‘-’, ‘p’, ‘o’, ‘r’, ‘t’, ‘a’, “'”, “'”, ‘v’, ‘i’, ‘p’, ‘-’, ‘n’, ‘o’, ‘v’, ‘a’, “'”, “'”, ‘d’, ‘v’, ‘r’, ‘-’, ‘c’, ‘a’, ‘n’, ‘a’, ‘l’, ‘-’, ‘2’, “'”, “'”, ‘d’, ‘v’, ‘r’, ‘-’, ‘c’, ‘a’, ‘n’, ‘a’, ‘l’, ‘-’, ‘3’, “'”, “'”, ‘d’, ‘v’, ‘r’, ‘-’, ‘c’, ‘a’, ‘n’, ‘a’, ‘l’, ‘-’, ‘4’, “'”, “'”, ‘d’, ‘v’, ‘r’, ‘-’, ‘c’, ‘a’, ‘n’, ‘a’, ‘l’, ‘-’, ‘5’, “'”, “'”, ‘d’, ‘v’, ‘r’, ‘-’, ‘c’, ‘a’, ‘n’, ‘a’, ‘l’, ‘-’, ‘6’, “'”]
(‘teste123’‘vip-3230-B-SL-G2’‘IC5-porta’‘vip-nova’‘dvr-canal-2’‘dvr-canal-3’‘dvr-canal-4’‘dvr-canal-5’‘dvr-canal-6’“”)
On select box the correct string like: “camera-room-01”, ando so on…
And on other string, can get other sql row parameter and final string is like:
“rtsp://localhost:8554/row.camera_id”
camera_id point to camera_name …
Any help, i am very confuse here kkkkk