Skip to content

Instantly share code, notes, and snippets.

View marcosp-araujo's full-sized avatar

marcosp-araujo marcosp-araujo

View GitHub Profile
@tvst
tvst / is_running_in_streamlit.py
Created May 20, 2020 20:35
Function to detect if the current script is running inside Streamlit
import threading
def is_running_in_streamlit():
thread = threading.current_thread()
return type(thread).__module__.startswith('streamlit.')