Hi There.
i using mongodb for my database and use jinja2 to display my template
But i have problem. when i write like this, i can get my data correctly.
if 'data' not in st.session_state:
st.session_state['data'] = []
qt_list2=[1, '4455abc'], [2, '5451abc']
for line in qt_list2:
st.session_state['data'].append(line)
st.write(st.session_state['data'])
and then the result will be like that :
[[1, '4455abc'], [2, '5451abc']]
i save this list [1, ‘4455abc’], [2, ‘5451abc’] to mongodb and the i call again the result like this
"[[1, '4455abc'], [2, '5451abc']]"
how possible can i remove double quote (") in streamlit or python. so streamlit can understand if that is a list not a string.
Hello there,
To convert the string representation of a list, such as “[[1, ‘4455abc’], [2, ‘5451abc’]]”, back into a list object in Python, you can use the ast.literal_eval() function from the ast module.