Spaces:
Sleeping
Sleeping
fixing bug
Browse files
app.py
CHANGED
|
@@ -1,19 +1,22 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import streamlit_ace as st_ace
|
| 3 |
-
from utils import execute_code, export_session
|
| 4 |
-
from chatbot import render_chatbot
|
| 5 |
-
import json
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
ace_theme = "chrome" if theme == "Light" else "monokai"
|
| 10 |
-
|
| 11 |
-
# Page configuration
|
| 12 |
st.set_page_config(
|
| 13 |
page_title="Interactive Code Editor with AI Assistant",
|
| 14 |
page_icon="π»",
|
| 15 |
layout="wide"
|
| 16 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# Initialize session state
|
| 19 |
if 'code_output' not in st.session_state:
|
|
@@ -37,7 +40,7 @@ with col1:
|
|
| 37 |
code = st_ace.st_ace(
|
| 38 |
placeholder="Write your Python code here...",
|
| 39 |
language="python",
|
| 40 |
-
theme=ace_theme, # β use selected theme
|
| 41 |
keybinding="vscode",
|
| 42 |
font_size=14,
|
| 43 |
min_lines=25,
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
# ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 4 |
+
# 1οΈβ£ PAGE CONFIG (MUST BE FIRST)
|
|
|
|
|
|
|
|
|
|
| 5 |
st.set_page_config(
|
| 6 |
page_title="Interactive Code Editor with AI Assistant",
|
| 7 |
page_icon="π»",
|
| 8 |
layout="wide"
|
| 9 |
)
|
| 10 |
+
# ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 11 |
+
|
| 12 |
+
# 2οΈβ£ THEME SELECTOR
|
| 13 |
+
theme = st.sidebar.selectbox("π¨ Editor Theme", ["Light", "Dark"])
|
| 14 |
+
ace_theme = "chrome" if theme == "Light" else "monokai"
|
| 15 |
+
|
| 16 |
+
import streamlit_ace as st_ace
|
| 17 |
+
from utils import execute_code, export_session
|
| 18 |
+
from chatbot import render_chatbot
|
| 19 |
+
import json
|
| 20 |
|
| 21 |
# Initialize session state
|
| 22 |
if 'code_output' not in st.session_state:
|
|
|
|
| 40 |
code = st_ace.st_ace(
|
| 41 |
placeholder="Write your Python code here...",
|
| 42 |
language="python",
|
| 43 |
+
theme=ace_theme, # β use the selected theme
|
| 44 |
keybinding="vscode",
|
| 45 |
font_size=14,
|
| 46 |
min_lines=25,
|