Spaces:
Sleeping
Sleeping
Update app.py
Browse files//LOG_ 111424_c
Make list of names persist across functions
//endlog
/commit
app.py
CHANGED
|
@@ -2,8 +2,8 @@ import streamlit as st
|
|
| 2 |
import random
|
| 3 |
|
| 4 |
class WheelOfNames:
|
| 5 |
-
def __init__(self):
|
| 6 |
-
self.names =
|
| 7 |
|
| 8 |
def add_name(self, name):
|
| 9 |
if name.strip():
|
|
@@ -76,8 +76,7 @@ def main():
|
|
| 76 |
if 'group_size_var' not in st.session_state:
|
| 77 |
st.session_state.group_size_var = "2"
|
| 78 |
|
| 79 |
-
wheel = WheelOfNames()
|
| 80 |
-
wheel.names = st.session_state.names
|
| 81 |
|
| 82 |
with st.sidebar:
|
| 83 |
st.subheader("Manage Names")
|
|
|
|
| 2 |
import random
|
| 3 |
|
| 4 |
class WheelOfNames:
|
| 5 |
+
def __init__(self, names):
|
| 6 |
+
self.names = names
|
| 7 |
|
| 8 |
def add_name(self, name):
|
| 9 |
if name.strip():
|
|
|
|
| 76 |
if 'group_size_var' not in st.session_state:
|
| 77 |
st.session_state.group_size_var = "2"
|
| 78 |
|
| 79 |
+
wheel = WheelOfNames(st.session_state.names)
|
|
|
|
| 80 |
|
| 81 |
with st.sidebar:
|
| 82 |
st.subheader("Manage Names")
|