Hello Folks - I am trying to use ‘sessionstate’ along with user input to create a login id, password page. Am using st.empty() to first initialize login and password widgets and then get input from the user.
if session_state.password != 'pwd123':
title = st.empty()
title.title("Welcome to this page")
subtitle = st.empty()
subtitle.header("Please enter your login details to proceed")
login = st.empty()
login.subheader("LOGIN")
login_id = st.empty()
login_id.text_input("Name")
print(login_id)
pwd_placeholder = st.empty()
pwd = pwd_placeholder.text_input("Password:", value="", type="password")
session_state.password = pwd
if session_state.password == 'pwd123':
pwd_placeholder.empty()
title.empty()
subtitle.empty()
login.empty()
login_id.empty()
main()
elif session_state.password != '':
st.error("the password you entered is incorrect")
else:
main()
I print out the “login_id” to get the name of the user also but whenever I do I get -
<streamlit.delta_generator.DeltaGenerator object at 0x000001EA17C0A588>
Any idea why? I would ideally like to get the “login_id” printed out.