vsj0702 commited on
Commit
8988e78
Β·
verified Β·
1 Parent(s): 55bd2c6

fixing bug

Browse files
Files changed (1) hide show
  1. app.py +13 -10
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
- # 1️⃣ Theme selector in the sidebar
8
- theme = st.sidebar.selectbox("🎨 Editor Theme", ["Light", "Dark"])
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,