File size: 329 Bytes
a576a00
 
 
 
 
 
 
 
 
 
 
9e0a453
1
2
3
4
5
6
7
8
9
10
11
12
13
import streamlit as st

def set_state_if_absent(key, value):
    if key not in st.session_state:
        st.session_state[key] = value

def set_initial_state():
    set_state_if_absent("username", "Provide a Twitter username")
    set_state_if_absent("result", None)

def reset_results(*args):
    st.session_state.result = None