st.checkbox("Google Translate", key="Google")
def new_word():
word = st.session_state["new word"]
if st.session_state["Google"]:
webbrowser.open(f"https://translate.google.com/?sl=en&tl=vi&text={word}")
st.text_input(label="Enter a word to check then press 'Enter'",
placeholder="Swim, climb, drink coffee, etc",
on_change=new_word,
key="new word")
As it’s supposed this app shoud take a word as an input and open it in a new tab.
However, the app works fine only on my local server, and the same version on streamlit doesn’t open any tabs.