Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error al enviar con Postman (da más detalles q en el pantallazo de anoche del grupo) #42

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{

"python.pythonPath": "venv/bin/python3",
"python.pythonPath": "venv/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true

Expand Down
16 changes: 16 additions & 0 deletions gonzalo/COCHE/print_bonito.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

def imprimir_bonito(diccionario):
key = diccionario.keys() # lista de claves
values = diccionario.values() # lista de valores

for clave in key:
print(f'|---{clave}---|')





# ---
usu = {'nombre': 'Alberto', 'aficion': 'scrapping', 'edad':'26'}

imprimir_bonito(usu)
30 changes: 30 additions & 0 deletions gonzalo/POSTMAN/err_postman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Hoy da más detalles que los q puse en el guasap del grupo:

Poniendo esto:
- http://127.0.0.1:5000/users
- {"name": "jose", "password": "lalala", "age": 36}

Esto es lo que da al hacer SEND del POST:

WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

[2019-11-19 11:23:18,722] ERROR in app: Exception on /users [POST]
Traceback (most recent call last):

File "C:\Users\Gonzalo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()

File "C:\Users\Gonzalo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
return self.finalize_request(rv)

File "C:\Users\Gonzalo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 1967, in finalize_request
response = self.make_response(rv)

File "C:\Users\Gonzalo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 2097, in make_response
"The view function did not return a valid response. The"

TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.
127.0.0.1 - - [19/Nov/2019 11:23:18] "POST /users HTTP/1.1" 500 -
31 changes: 31 additions & 0 deletions gonzalo/calculadora.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

def calcular(primer_numero, segundo_numero):
operacion = input(" operación? < + , - , x , / > : ")

if operacion == '+':
resultado = primer_numero + segundo_numero
print(f'resultado: {resultado}')
elif operacion == '-':
resultado = primer_numero - segundo_numero
print(f'resultado: {resultado}')
elif operacion == 'x':
resultado = primer_numero * segundo_numero
print(f'resultado: {resultado}')
elif operacion == '/':
resultado = primer_numero / segundo_numero
print(f'resultado: {resultado}')

primer_numero = resultado
segundo_numero = int(input(" -> siguiente número: "))

calcular(primer_numero, segundo_numero)


# --------

primer_numero = int(input(" -> primer número: "))
operacion = input(" operación? < + , - , x , / > : ")
segundo_numero = int(input(" -> segundo número: "))

calcular(primer_numero, operacion, segundo_numero)

31 changes: 31 additions & 0 deletions gonzalo/calculadora2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

def calcular(primer_numero, operacion, segundo_numero):

if operacion == '+':
resultado = primer_numero + segundo_numero
print(f'resultado: {resultado}')
elif operacion == '-':
resultado = primer_numero - segundo_numero
print(f'resultado: {resultado}')
elif operacion == 'x':
resultado = primer_numero * segundo_numero
print(f'resultado: {resultado}')
elif operacion == '/':
resultado = primer_numero / segundo_numero
print(f'resultado: {resultado}')

primer_numero = resultado
operacion = input(" operación? < + , - , x , / > : ")
segundo_numero = int(input(" -> siguiente número: "))

calcular(primer_numero, operacion, segundo_numero)


# --------

primer_numero = int(input(" -> primer número: "))
operacion = input(" operación? < + , - , x , / > : ")
segundo_numero = int(input(" -> segundo número: "))

calcular(primer_numero, operacion, segundo_numero)

15 changes: 15 additions & 0 deletions gonzalo/eliminar_de_lista.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def eliminar_elenentos_lista(lista_origen, *n):

for number in n:
lista_origen.remove(number)

return lista_origen


# ----
mi_lista = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

lista_reducida = eliminar_elenentos_lista(mi_lista, 2, 6, 7, 9)

print(lista_reducida)