[Python] Streamlit Javascript integration

Discussão em 'Python' iniciado por Stack, Janeiro 30, 2025.

  1. Stack

    Stack Membro Participativo

    I can't get any js function in streamlit (python) to work, the return value is always 0, no matter how I tried to write it. For instance

    anonymous = st_javascript("""
    (() => {
    return 2;
    })()
    """)

    st.write(f"JavaScript returned: {anonymous}")


    What am I doing wrong here? Chatgpt and claude couldn't help, nor did I see any helpfull posts here.

    Can someone provide the correct syntax?

    Continue reading...

Compartilhe esta Página