Spaces:
Sleeping
Sleeping
Download app.py from OncomIA01/pythontest: direct link, hf CLI and curl.
- Browser
- Download file 4.28 kB
-
https://huggingface.co/spaces/OncomIA01/pythontest/resolve/main/app.py
- Command line
-
hf download hf://spaces/OncomIA01/pythontest/app.py
-
curl -L -o app.py https://huggingface.co/spaces/OncomIA01/pythontest/resolve/main/app.py
4.28 kB
| import streamlit as st | |
| st.set_page_config( | |
| page_title="Aula Python", | |
| page_icon="🐍", | |
| layout="wide", | |
| initial_sidebar_state="collapsed", | |
| ) | |
| st.markdown( | |
| """ | |
| <style> | |
| .stApp { background: #F5F8FA; } | |
| .block-container { max-width: 1160px; padding-top: 3.2rem; } | |
| .hero { text-align: center; margin: 1rem auto 2.8rem; } | |
| .hero-badge { | |
| display: inline-block; padding: .45rem .9rem; border-radius: 999px; | |
| background: #101820; color: white; font-weight: 700; letter-spacing: .04em; | |
| border-bottom: 4px solid #009FE3; | |
| } | |
| .hero h1 { | |
| margin: 1rem 0 .5rem; color: #101820; font-size: clamp(2.5rem, 6vw, 4.6rem); | |
| line-height: 1.02; letter-spacing: -.04em; | |
| } | |
| .hero p { color: #475569; font-size: 1.2rem; max-width: 720px; margin: auto; } | |
| .choice-card { | |
| min-height: 20rem; padding: 1.6rem; border-radius: 24px; background: rgba(255,255,255,.9); | |
| border: 1px solid rgba(148,163,184,.35); box-shadow: 0 18px 45px rgba(15,23,42,.10); | |
| } | |
| .choice-icon { font-size: 3rem; margin-bottom: .7rem; } | |
| .choice-card.practice { border-top: 4px solid #009FE3; } | |
| .choice-card h2 { color: #101820; margin: 0 0 .7rem; } | |
| .choice-card p { color: #64748b; font-size: 1.04rem; line-height: 1.65; } | |
| .tag { | |
| display: inline-block; margin-top: .65rem; padding: .3rem .65rem; border-radius: 8px; | |
| background: #E6F5FC; color: #007DB3; font-size: .86rem; font-weight: 700; | |
| } | |
| div.stButton > button { | |
| width: 100%; min-height: 3.4rem; border: 0; border-radius: 14px; | |
| background: #101820; color: white; font-size: 1.05rem; font-weight: 800; | |
| box-shadow: 0 8px 18px rgba(16,24,32,.18); | |
| } | |
| div.stButton > button:hover { background: #009FE3; color: white; border: 0; } | |
| .footer { text-align:center; color:#64748b; margin-top:3.2rem; font-size:.92rem; } | |
| [data-testid="stSidebar"], | |
| [data-testid="stSidebarCollapsedControl"], | |
| [data-testid="stExpandSidebarButton"], | |
| [data-testid="collapsedControl"] { display: none !important; } | |
| </style> | |
| <section class="hero"> | |
| <span class="hero-badge">FUNDAMENTOS DE COMPUTACIÓN</span> | |
| <h1>Aprende Python<br>paso a paso</h1> | |
| <p>Sigue la clase, practica con código Python o comprueba lo que sabes en el simulador.</p> | |
| </section> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| lesson_col, exam_col, practice_col = st.columns(3, gap="medium") | |
| with lesson_col: | |
| st.markdown( | |
| """ | |
| <div class="choice-card"> | |
| <div class="choice-icon">🐍</div> | |
| <h2>Clase guiada</h2> | |
| <p>La clase completa de Python, de arriba abajo: diapositiva, código, diagrama de flujo y ejecución explicada. Incluye los problemas del Tema 2 y del examen parcial resueltos con diagrama y código.</p> | |
| <span class="tag">TEORÍA · CÓDIGO · DIAGRAMA · EJECUCIÓN</span> | |
| </div> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| if st.button("Abrir clase guiada →", key="open_lesson"): | |
| st.switch_page("pages/3_Clase_guiada.py") | |
| with exam_col: | |
| st.markdown( | |
| """ | |
| <div class="choice-card"> | |
| <div class="choice-icon">📝</div> | |
| <h2>Simulador de examen</h2> | |
| <p>Configura un simulacro general y revisa tu nota y tu rendimiento al terminar.</p> | |
| </div> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| if st.button("Abrir simulador →", key="open_exam"): | |
| st.switch_page("pages/2_Simulador_de_examen.py") | |
| with practice_col: | |
| st.markdown( | |
| """ | |
| <div class="choice-card practice"> | |
| <div class="choice-icon">🧩</div> | |
| <h2>Ejercicios de clase</h2> | |
| <p>Predice la salida, completa código y compara soluciones de Python. Puedes revelar la respuesta y seguir su explicación paso a paso.</p> | |
| <span class="tag">116 EJERCICIOS DE PYTHON</span> | |
| </div> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| if st.button("Practicar Python →", key="open_practice"): | |
| st.switch_page("pages/1_Ejercicios_de_clase.py") | |
| st.markdown( | |
| '<p class="footer">🐍 Python · Diagramas de flujo · Pensamiento computacional</p>', | |
| unsafe_allow_html=True, | |
| ) | |