Is there any good ways to control the behaviour of widgets when no action are taking,I want to control that no action no response,I have to use if else to control the behaviour,there for lots of if else in the code make the code is very dirty,would like to see some great solutions.
Steps to reproduce
options = st.multiselect( 'please select factors for analysis', ["Zscore"] ) if options is not None: # do something else: # do nothing and do not perform any code in the back of this
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
any way do not usedso many if else
Explain what you expect to happen when you run the code above.
Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.
- Streamlit version: (get it with
$ streamlit version)
- Python version: (get it with
$ python --version)
- Using Conda? PipEnv? PyEnv? Pex?
- OS version:
- Browser version:
Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.
- Link to your GitHub repo:
- Link to your deployed app:
If needed, add any other context about the problem here.