Spaces:
Runtime error
Runtime error
Commit
路
a977c80
1
Parent(s):
296c9ad
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
from kerykeion import AstrologicalSubject, KerykeionChartSVG
|
3 |
from kerykeion.report import Report
|
|
|
4 |
import os
|
5 |
|
6 |
def get_user_input():
|
@@ -44,8 +45,9 @@ def main():
|
|
44 |
st.markdown("## Descargar Informe")
|
45 |
st.write("Haga clic en el bot贸n de abajo para descargar el informe en un archivo de texto.")
|
46 |
|
47 |
-
|
48 |
-
|
|
|
49 |
if st.button("Descargar Informe"):
|
50 |
with open(informe_file_path, 'w') as file:
|
51 |
sys.stdout = file
|
@@ -61,11 +63,11 @@ def main():
|
|
61 |
|
62 |
# Search and display an SVG image in the current directory
|
63 |
st.markdown("## Gr谩fico Astral Generado")
|
64 |
-
svg_files = [f for f in os.listdir(
|
65 |
|
66 |
if svg_files:
|
67 |
svg_file = svg_files[0] # Display the first SVG file found
|
68 |
-
st.image(os.path.join(
|
69 |
else:
|
70 |
st.write("No se encontraron archivos SVG en el directorio actual.")
|
71 |
|
|
|
1 |
import streamlit as st
|
2 |
from kerykeion import AstrologicalSubject, KerykeionChartSVG
|
3 |
from kerykeion.report import Report
|
4 |
+
import sys
|
5 |
import os
|
6 |
|
7 |
def get_user_input():
|
|
|
45 |
st.markdown("## Descargar Informe")
|
46 |
st.write("Haga clic en el bot贸n de abajo para descargar el informe en un archivo de texto.")
|
47 |
|
48 |
+
script_dir = os.path.dirname(__file__)
|
49 |
+
informe_file_path = os.path.join(script_dir, "informe.txt")
|
50 |
+
|
51 |
if st.button("Descargar Informe"):
|
52 |
with open(informe_file_path, 'w') as file:
|
53 |
sys.stdout = file
|
|
|
63 |
|
64 |
# Search and display an SVG image in the current directory
|
65 |
st.markdown("## Gr谩fico Astral Generado")
|
66 |
+
svg_files = [f for f in os.listdir(script_dir) if f.endswith(".svg")]
|
67 |
|
68 |
if svg_files:
|
69 |
svg_file = svg_files[0] # Display the first SVG file found
|
70 |
+
st.image(os.path.join(script_dir, svg_file), use_container_width=True)
|
71 |
else:
|
72 |
st.write("No se encontraron archivos SVG en el directorio actual.")
|
73 |
|