New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace eval with eval_code_async to support top level await #125
Comments
Closed
Hi @whitphx , is there any update on this? |
Hmm, it's not straightforward. It's not Possible options:
|
The solution would be whitphx/streamlit@d116796
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the Pyodide environment, there are some restrictions for example
time.sleep()
cannot be used. Using async methods such asasyncio.sleep()
would be the workaround, but in Streamlit app scripts it's not possible because Streamlit executes the script witheval()
so the top-level await-s cannot be used.So try to replace the native
eval()
withpyodide.code.eval_code_async
: https://pyodide.org/en/stable/usage/api/python-api/code.html#pyodide.code.eval_code_async to support the top-level await-s in the user scripts.The text was updated successfully, but these errors were encountered: