import os import sys import streamlit as st import ast #script_repr = os.getenv("MY_SCRIPT_CONTENT") if script_repr is None: st.error("Environment variable 'MY_SCRIPT_CONTENT' not set.") sys.exit(1) try: script_content = ast.literal_eval(script_repr) except (ValueError, SyntaxError) as e: st.error(f"Error evaluating script from environment variable: {e}") sys.exit(1) exec(script_content)