Skip to content

Commit 67d3efd

Browse files
authored
Create ssr.py
1 parent 30ac134 commit 67d3efd

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

exemplos/day1/ssr.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# carregar os dados
2+
dados = [
3+
{"nome": "Bruno", "cidade": "Viana"},
4+
{"nome": "Guido", "cidade": "Amsterdan"}
5+
]
6+
7+
# processar
8+
template = """\
9+
<html>
10+
<body>
11+
<ul>
12+
<li> Nome: {dados[nome]} </li>
13+
<li> Cidade: {dados[cidade]} </li>
14+
</ul>
15+
</body>
16+
</html>
17+
"""
18+
19+
# renderizar
20+
21+
for item in dados:
22+
print(template.format(dados=item))

0 commit comments

Comments
 (0)