Skip to content

TomJohnH/streamlit-debug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

streamlit-debug

A handy tool for streamlit app debugging. Example: https://stdebug.streamlit.app/

Usage:

  1. Download st_debug.py and debug.css
  2. Import module
import st_debug as d
  1. Load css
def local_css(file_name):
    with open(file_name) as f:
        st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)

local_css("debug.css")
  1. At the bottom of your code make additional div:
if "debug_string" in st.session_state:
    st.markdown(
        f'<div class="debug">{ st.session_state["debug_string"]}</div>',
        unsafe_allow_html=True,
    )
  1. Write debugging commands
a = np.matrix("1 2; 3 4")
d.debug("this presents state of the matrix " + str(a))

Changelog:

14.01.2023

  • css update, new better visuals

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published