AÑADIMOS LOGICA al TPL - Plantilla

This commit is contained in:
fenix 2024-02-12 17:20:41 +01:00
parent ee87a0715a
commit ef3490b8f5
9 changed files with 71 additions and 9 deletions

View File

@ -9,3 +9,7 @@ Doc.: https://python-docs-es.readthedocs.io/es/3.10/library/venv.html
* Python ~ tutorial Jinja templates
https://realpython.com/primer-on-jinja-templating/
* Control flow - Jinja tpl 's
MUSICA INSTRUMENTAL : Wim Mertens

9
message_frieda.txt Normal file
View File

@ -0,0 +1,9 @@
HOLA! Frieda,
Estoy happy to inform you that you did very well on today's Python Challenge.
HAs alcanzado esta puntuacion : 92 de { max_score }} PUNTOS !
see you tomorrow, nos vemos :-)
Mr. JokerPy

9
message_fritz.txt Normal file
View File

@ -0,0 +1,9 @@
HOLA! Fritz,
Estoy happy to inform you that you did very well on today's Python Challenge.
HAs alcanzado esta puntuacion : 40 de { max_score }} PUNTOS !
see you tomorrow, nos vemos :-)
Mr. JokerPy

9
message_gergeley.txt Normal file
View File

@ -0,0 +1,9 @@
HOLA! Gergeley,
Estoy happy to inform you that you did very well on today's Python Challenge.
HAs alcanzado esta puntuacion : 87 de { max_score }} PUNTOS !
see you tomorrow, nos vemos :-)
Mr. JokerPy

9
message_sandrine.txt Normal file
View File

@ -0,0 +1,9 @@
HOLA! Sandrine,
Estoy happy to inform you that you did very well on today's Python Challenge.
HAs alcanzado esta puntuacion : 100 de { max_score }} PUNTOS !
see you tomorrow, nos vemos :-)
Mr. JokerPy

9
message_sirius.txt Normal file
View File

@ -0,0 +1,9 @@
HOLA! Sirius,
Estoy happy to inform you that you did very well on today's Python Challenge.
HAs alcanzado esta puntuacion : 75 de { max_score }} PUNTOS !
see you tomorrow, nos vemos :-)
Mr. JokerPy

View File

@ -1,9 +0,0 @@
{# templates/message.txt #}
HOLA! {{ name }},
Estoy happy to inform you that you did very well on today's {{ test_name }}.
HAs alcanzado esta puntuación : {{ score }} de { max_score }} PUNTOS !
see you tomorrow, nos vemos :-)
Mr. JokerPy

20
templates/message.txt Normal file
View File

@ -0,0 +1,20 @@
{# templates/message.txt #}
HOLA! {{ name }},
{% if score > 80 %}
( Acá Informamos tan sólo en caso de una cierta puntuación, por encima de un umbral )
Estoy happy to inform you that you did very well on today's {{ test_name }}.
HAs alcanzado esta puntuacion : {{ score }} de { max_score }} PUNTOS ! ;-)
{% else %}
Vaya! Siento informarte de que tu puntuacuón : {{ score }} es más que mejorable ... {{ test_name }} :-|
{% endif %}
see you tomorrow, nos vemos :-)
Mr. JokerPy

View File

@ -8,6 +8,8 @@ students = [
{"name": "Sandrine", "score": 100},
{"name": "Gergeley", "score": 87},
{"name": "Frieda", "score": 92},
{"name": "Fritz", "score": 40},
{"name": "Sirius", "score": 75},
]
environment = Environment(loader=FileSystemLoader("templates/"))