Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,24 +2,15 @@ import streamlit as st
|
|
| 2 |
import os
|
| 3 |
import base64
|
| 4 |
import types
|
| 5 |
-
|
| 6 |
-
# Secretμμ μ μ₯λ μ½λ κ°μ Έμ€κΈ°
|
| 7 |
app_code = os.environ.get("APP", "")
|
| 8 |
-
|
| 9 |
-
# μ½λ μ€ν ν¨μ
|
| 10 |
def execute_code(code_str):
|
| 11 |
try:
|
| 12 |
-
# μ€ν κ°λ₯ν μ½λλ‘ λ³ν
|
| 13 |
code_module = types.ModuleType('dynamic_code')
|
| 14 |
exec(code_str, code_module.__dict__)
|
| 15 |
-
|
| 16 |
-
# νμν ν¨μ μ€ν
|
| 17 |
if hasattr(code_module, 'main'):
|
| 18 |
code_module.main()
|
| 19 |
except Exception as e:
|
| 20 |
st.error(f"μ½λ μ€ν μ€ μ€λ₯ λ°μ: {str(e)}")
|
| 21 |
-
|
| 22 |
-
# μ½λ μ€ν
|
| 23 |
if app_code:
|
| 24 |
execute_code(app_code)
|
| 25 |
else:
|
|
|
|
| 2 |
import os
|
| 3 |
import base64
|
| 4 |
import types
|
|
|
|
|
|
|
| 5 |
app_code = os.environ.get("APP", "")
|
|
|
|
|
|
|
| 6 |
def execute_code(code_str):
|
| 7 |
try:
|
|
|
|
| 8 |
code_module = types.ModuleType('dynamic_code')
|
| 9 |
exec(code_str, code_module.__dict__)
|
|
|
|
|
|
|
| 10 |
if hasattr(code_module, 'main'):
|
| 11 |
code_module.main()
|
| 12 |
except Exception as e:
|
| 13 |
st.error(f"μ½λ μ€ν μ€ μ€λ₯ λ°μ: {str(e)}")
|
|
|
|
|
|
|
| 14 |
if app_code:
|
| 15 |
execute_code(app_code)
|
| 16 |
else:
|