Questions tagged as 'python-3.x'

2
answers

Python script does not generate the graph as expected

My algorithm in Python is running perfectly, I just can not generate the graph! I could not identify the error ... What's wrong? import matplotlib.pyplot as plt va=float(input('Digite o valor a ser aplicado: ')) juros=1.05 inflacao=1.02 saque...
asked by 06.06.2018 / 20:52
1
answer

How do I start from Side using end="" with the Time Module included

import time for i in range(0,10,+1): print(".", end="") time.sleep(1) Well here is the Program. I would like to know how I can start the. Ex. During this time of 1 second ... when I do not use the end it works but printing down.     
asked by 12.06.2018 / 00:04
0
answers

Relating List Values in Python

I would like to list the values of two lists that were stored through input . from datetime import datetime print('\n' + 'Desafio 054 — Maioridade' + '\n') nome_pessoas = [] idade_pessoas = [] lista = ["primeira", "segunda"] for ordem...
asked by 03.06.2018 / 19:52
0
answers

ERR_INVALID_HTTP_RESPONSE when requesting with axios on http server python

Hello, I have this simple server in python: from http.server import BaseHTTPRequestHandler, HTTPServer class S(BaseHTTPRequestHandler): def _set_headers(self): self.send_response(200) self.send_header('Content-type', 'text...
asked by 03.06.2018 / 21:49
0
answers

Convert POST request made in Curl to python requests

I have the following command in Curl that makes a POST request. curl -i -s -k -X $'POST' \ -H $'Host: router.jorge.com' -H $'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0' -H $'Accept: text/html,appl...
asked by 02.06.2018 / 02:01
0
answers

How to make this code work better (list of combinations)?

import random def ordenar(inputx): inputx = list(inputx) inputx = sorted(inputx, key=int) return inputx def get_numbers(totall): return random.sample(numeros, totall) numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,...
asked by 02.06.2018 / 02:41
2
answers

How to find and display the position of an item in the list, not setting the string value for the search? [duplicate]

How to find and display the position of an item in the list, not setting the string value for the search? Ex: nome_pessoa = str(input('Informe o seu nome completo: ')) lista_nomes = nome_pessoa.split() After the names are divided an...
asked by 01.06.2018 / 00:59
1
answer

Form in Flask does not work [closed]

When I click the Send button nothing happens, I leave a blank field, idem. routes.py file from flask import * from forms import * app=Flask(__name__) @app.route('/') @app.route('/home') def home(): return render_template('homepage.html...
asked by 01.06.2018 / 21:59
0
answers

save value of a tkinter button

Basically, I generate buttons within a for that runs through a dictionary, as the dictionary size varies with each search. for a in resultados: id = a['id'] btnDetails = Button(self.label1, text=a['nome'], command=lambda : self...
asked by 31.05.2018 / 04:01
1
answer

how to get data from outside and add in an existing function in Python

I'm creating a little game of dice but when I want to put a dot of points I'm not getting ... def get_dados(): dado1 = int(input("Digite o número para o primeiro dado: ")) dado2 = int(input("Digite o número para o segundo dado: ")) retur...
asked by 27.05.2018 / 22:37