Posts by nmenezes • 261 points
4 posts
-
7
votes2
answers196
viewsA: Why do I need to use an application server with Django?
In addition to what Kauã replied, a program with uwsgi or Gunicorn has other tasks. Their first function is to communicate with the web server, using the wsgi protocol, as already explained. The web…
-
0
votes1
answer58
viewsA: importing the connection of a file. py
Whoa, try it with this: import json from datetime import datetime from peewee import (PostgresqlDatabase, CompositeKey, Model, CharField, DateTimeField, DoubleField, IntegerField, TextField,…
python-3.xanswered nmenezes 261 -
0
votes5
answers821
viewsA: Avoid blank input data
Apart from the preconception against whiles... :-D lista = [] x = 1 while x < 3: v = input(f"Digite o {x}º número: ") try: lista.append(float(v)) x += 1 except ValueError: print("Valor inválido,…
-
1
votes4
answers2542
viewsA: Access list element within Python list
I think you’re wanting something that gets x and returns the index in the list, but since x is inside another list needs a function: def procura_lista(l, x): for posicao, valor in enumerate(l): if…