This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/FranzDiebold/898396a6be785d9b5ca6f3706ef9b0bc | |
"""Hack to add per-session state to Streamlit. | |
Works for Streamlit >= v0.65 | |
Usage | |
----- | |
>>> import SessionState | |
>>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import streamlit as st | |
from .streamlit_utils import SessionState | |
session_state = SessionState.get(page=1) | |
def main(): | |
# Render the readme as markdown using st.markdown. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!pip install lxml | |
import bs4 | |
import bs4.builder._lxml | |
bs4.builder.register_treebuilders_from(bs4.builder._lxml) | |
# then you can | |
soup = BeautifulSoup(data, 'lxml') # no error |