question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Selection Option for Streamlit

See original GitHub issue

Hello, thanks a lot for sharing your project!

The README says that the checkbox option is relevant only in the context of Jupyter Notebook. Is there no way of extracting the selection through Streamlit?

Thank you in advance and apologies for the trivial question.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
spadaveccommented, Mar 2, 2022

Just figured it out! For posterity:

row1_1, row1_2 = st.columns((2,3))

if st.button('Show Selection'):
    clipboard = pyperclip.paste()
    selection = literal_eval(clipboard)
    key = list(selection.keys())
    for key in index:
        specific_smiles = selection[key]
        with row1_2:
            image_holder = st.empty()
            mol = Chem.MolFromSmiles(specific_smiles)
            im=Draw.MolToImage(mol)
            image_holder.image(im)

1reaction
eereenah-fastcommented, Oct 13, 2021

I used pyperclip instead. Works like a charm! Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

st.selectbox - Streamlit Docs
st.selectbox displays a select widget. ... It receives the option as an argument and its output will be cast to str. key (str...
Read more >
How to add selectbox in Streamlit - ProjectPro
You can add a select box to the Streamlit app using "st.selectbox". It returns a string. ... options -> The labels for the...
Read more >
How to use the streamlit.selectbox function in streamlit - Snyk
selectbox("Select Author", options=[author_all] + ast.database.AUTHORS) if author == author_all: author = None show_awesome_resources_only = st.checkbox("Show ...
Read more >
Set default value for selectbox - python - Stack Overflow
Use the index keyword of the selectbox widget. Pass the index of the value in the options list that you want to be...
Read more >
Selection Widgets with Streamlit - Develop Web Apps with ...
Selection of single item#. If we want users to select just one item out of several options, Streamlit offers the following three widgets:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found