This file contains 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 time | |
import random | |
from queue import Queue | |
import threading | |
import streamlit as st | |
from streamlit.runtime.scriptrunner import add_script_run_ctx | |
pre_msgs = [] | |
result_msgs = [] | |
post_msgs = [] |
This file contains 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
# | |
# This seems to be a common issue amongst new Streamlit users, so I wrote a mini-tutorial app to explain how widgets | |
# are used with initialized values and how to make them stick using session state and callbacks. | |
# | |
# There are three ways: | |
# | |
# (1) The most basic where the initial value is not given but the widget is always reset, | |
# (2) Where it’s initialized but there are issues getting the return value to stick, and finally | |
# (3) Overcoming all issues with session state and callbacks. | |
# |
This file contains 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
# How to use: | |
# | |
# [1] Ensure you have `debugpy` installed: | |
# | |
# > pip install debugpy | |
# | |
# [2] In your main streamlit app: | |
# | |
# import streamlit_debug | |
# streamlit_debug.set(flag=True, wait_for_client=True, host='localhost', port=8765) |
This file contains 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
from typing import Literal | |
import streamlit as st | |
from streamlit.components.v1 import html | |
FIXED_CONTAINER_CSS = """ | |
div[data-testid="stVerticalBlockBorderWrapper"]:has(div.fixed-container-{id}):not(:has(div.not-fixed-container)) {{ | |
position: {mode}; | |
width: inherit; |
This file contains 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
# UPDATED: 5-MAY-2023 | |
from multiprocessing import Pool, freeze_support | |
from time import sleep | |
import streamlit as st | |
# https://discuss.streamlit.io/t/stqdm-a-tqdm-like-progress-bar-for-streamlit/10097 | |
# pip install stqdm | |
from stqdm import stqdm |
This file contains 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 streamlit as st | |
import pandas as pd | |
st.header('Flexible Data Filtering UI') | |
data = [ | |
{ | |
'name':'name1', | |
'nickname':'nickname1', | |
'date':2010, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder