Download app.py from LEWOPO/RSD: direct link, hf CLI and curl.
- Browser
- Download file 1.64 kB
-
https://huggingface.co/spaces/LEWOPO/RSD/resolve/main/app.py
- Command line
-
hf download hf://spaces/LEWOPO/RSD/app.py
-
curl -L -o app.py https://huggingface.co/spaces/LEWOPO/RSD/resolve/main/app.py
1.64 kB
| import streamlit as st | |
| # Style CSS pour définir le fond vert | |
| st.markdown(""" | |
| <style> | |
| body { | |
| background-color: green; | |
| } | |
| .stButton > button { | |
| background-color: #4CAF50; /* Vert bouton */ | |
| color: white; | |
| font-size: 16px; | |
| border-radius: 10px; | |
| } | |
| </style> | |
| """, unsafe_allow_html=True) | |
| # Titre de l'application | |
| st.title("Calculateur d'IMC") | |
| # Saisie des données utilisateur | |
| poids = st.number_input("Entrez votre poids (kg):", min_value=1.0, format="%.2f") | |
| poids2 = st.number_input("Entrez votre poids a la dernière consultation(kg):", min_value=1.0, format="%.2f") | |
| AG1=st.number_input("Entrez Age première consultation:", min_value=1.0, format="%.2f") | |
| AG2=st.number_input("Entrez Age seconde consultation:", min_value=1.0, format="%.2f") | |
| taille = st.number_input("Entrez votre taille (m):", min_value=0.5, format="%.2f") | |
| # Calcul de l'IMC avec bouton | |
| if st.button("Calculer l'IMC"): | |
| if taille > 0: | |
| imc = poids / (taille ** 2) | |
| var=(poids-poids2)/(AG2-AG1) | |
| st.success(f"Votre IMC est de : {imc:.2f}") | |
| st.success(f"Votre VAR est de : {var:.2f}") | |
| # Interprétation de l'IMC | |
| if imc < 18.5: | |
| st.info("Vous êtes en insuffisance pondérale.") | |
| elif 18.5 <= imc < 24.9: | |
| st.success("Votre poids est normal.") | |
| elif 25 <= imc < 29.9: | |
| st.warning("Vous êtes en surpoids.") | |
| else: | |
| st.error("Vous êtes en obésité.") | |
| else: | |
| st.error("Veuillez entrer une taille valide.") | |