Upload app.py
Browse files
app.py
CHANGED
|
@@ -62,6 +62,23 @@ def start_streamlit():
|
|
| 62 |
# Use SimpleMain.py for basic functionality
|
| 63 |
streamlit_app = os.path.join(root_dir, "webui", "SimpleMain.py")
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
# Start Streamlit using exec to replace current process
|
| 66 |
os.execvp(sys.executable, [
|
| 67 |
sys.executable, "-m", "streamlit", "run",
|
|
@@ -73,4 +90,14 @@ def start_streamlit():
|
|
| 73 |
|
| 74 |
if __name__ == "__main__":
|
| 75 |
print("🎬 MoneyPrinterTurbo - Stage 2: Streamlit Integration")
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
# Use SimpleMain.py for basic functionality
|
| 63 |
streamlit_app = os.path.join(root_dir, "webui", "SimpleMain.py")
|
| 64 |
|
| 65 |
+
if not os.path.exists(streamlit_app):
|
| 66 |
+
print(f"❌ SimpleMain.py not found at: {streamlit_app}")
|
| 67 |
+
# Fallback to creating a minimal inline app
|
| 68 |
+
minimal_app = os.path.join(root_dir, "minimal_app.py")
|
| 69 |
+
with open(minimal_app, 'w', encoding='utf-8') as f:
|
| 70 |
+
f.write('''
|
| 71 |
+
import streamlit as st
|
| 72 |
+
st.set_page_config(page_title="MoneyPrinterTurbo", page_icon="🎬")
|
| 73 |
+
st.title("🎬 MoneyPrinterTurbo")
|
| 74 |
+
st.success("✅ 应用成功启动!")
|
| 75 |
+
st.info("这是一个最小化版本,用于验证 Streamlit 集成。")
|
| 76 |
+
st.write("如果您看到这个页面,说明 Stage 2 部署成功!")
|
| 77 |
+
''')
|
| 78 |
+
streamlit_app = minimal_app
|
| 79 |
+
|
| 80 |
+
print(f"📄 Using Streamlit app: {streamlit_app}")
|
| 81 |
+
|
| 82 |
# Start Streamlit using exec to replace current process
|
| 83 |
os.execvp(sys.executable, [
|
| 84 |
sys.executable, "-m", "streamlit", "run",
|
|
|
|
| 90 |
|
| 91 |
if __name__ == "__main__":
|
| 92 |
print("🎬 MoneyPrinterTurbo - Stage 2: Streamlit Integration")
|
| 93 |
+
try:
|
| 94 |
+
start_streamlit()
|
| 95 |
+
except Exception as e:
|
| 96 |
+
print(f"❌ Error starting application: {e}")
|
| 97 |
+
import traceback
|
| 98 |
+
traceback.print_exc()
|
| 99 |
+
# Keep process alive for debugging
|
| 100 |
+
import time
|
| 101 |
+
while True:
|
| 102 |
+
print("⏰ Keeping process alive for debugging...")
|
| 103 |
+
time.sleep(30)
|