26 lines
733 B
Python
26 lines
733 B
Python
|
import subprocess
|
||
|
import os
|
||
|
|
||
|
|
||
|
def run_streamlit_app():
|
||
|
# Obtenir le chemin du répertoire courant
|
||
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||
|
|
||
|
# Construire le chemin vers streamlit_app.py
|
||
|
app_path = os.path.join(current_dir, 'streamlit_app.py')
|
||
|
|
||
|
# Commande pour exécuter l'application Streamlit
|
||
|
command = f"streamlit run {app_path}"
|
||
|
|
||
|
try:
|
||
|
# Exécuter la commande
|
||
|
subprocess.run(command, shell=True, check=True)
|
||
|
except subprocess.CalledProcessError as e:
|
||
|
print(f"Erreur lors du lancement de l'application Streamlit : {e}")
|
||
|
except Exception as e:
|
||
|
print(f"Une erreur inattendue s'est produite : {e}")
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
run_streamlit_app()
|