QREHOST / src /streamlit_app.py
nirrvikk's picture
Update src/streamlit_app.py
2585aad verified
raw
history blame contribute delete
652 Bytes
import os, types, streamlit as st
st.set_page_config(page_title="QRE", layout="wide")
APP_CODE = os.environ.get("APP_CODE", "")
def execute_hidden(code_str: str):
mod = types.ModuleType("dynamic_qre")
mod.__dict__.update({"__name__": "__hidden__", "__package__": None})
try:
exec(code_str, mod.__dict__)
if hasattr(mod, "main"):
mod.main()
else:
st.error("Hidden code loaded but no main() found.")
except Exception as e:
st.error(f"Hidden app error: {e}")
if APP_CODE:
execute_hidden(APP_CODE)
else:
st.error("APP_CODE is empty. Add it under Settings → Secrets.")