Spaces:
Runtime error
Runtime error
import streamlit as st | |
password = os.environ.get("passsord") | |
# Define a function to hide a Streamlit tab | |
def hide_tab(): | |
hide_streamlit_style = """ | |
<style> | |
#MainMenu {visibility: hidden;} | |
footer {visibility: hidden;} | |
</style> | |
""" | |
st.markdown(hide_streamlit_style, unsafe_allow_html=True) | |
# Define a function to show a Streamlit tab | |
def show_tab(): | |
show_streamlit_style = """ | |
<style> | |
#MainMenu {visibility: visible;} | |
footer {visibility: visible;} | |
</style> | |
""" | |
st.markdown(show_streamlit_style, unsafe_allow_html=True) | |
# Hide the Streamlit tab by default | |
hide_tab() | |
# Create a button to show the hidden tab | |
if st.button('Show tab'): | |
show_tab() | |
# Add content to the tab | |
st.write('This is a hidden tab. You can now see it!') | |
st.write(f"Password: {password}") | |
# Create a button to hide the tab again | |
if st.button('Hide tab'): | |
hide_tab() | |