Questions tagged as 'python'

1
answer

Gif API in python

It is my question and the following I have this script where I type the name of the gif that I want and it returns me several type of url of the size (width, height) of the randomly drawn gif, I wanted it to return me only this:    image_url...
asked by 01.05.2018 / 19:18
1
answer

Send form Django

I'm new to python and I'm trying to make a registration, when I click send nothing happens, no post views.py from django.http import HttpResponse from django.shortcuts import render from portal.cadastro.forms import CadastroForm...
asked by 09.08.2017 / 19:06
1
answer

OpenCV training help

In a process of creating a haarcascade, I performed the procedures according to the tutorials of the OpenCV library and arrived at the result of a vector with the number of 70 positive images named positives.vec . The vector is being generate...
asked by 06.09.2017 / 02:45
2
answers

Get the number of digits in a number

I have been asked to make an algorithm in Python to know the number of digits in a number, is there a way to do it without the manipulation of strings ? def achaTamanho(x): a = str(x) if len(a) > 1: if a[0] == '0':...
asked by 25.01.2018 / 22:22
2
answers

How to sort a list by the number of occurrences? In Python

Type, I have a list like this: lista = [1,1,2,3,3,3] And I want to order it to stay lista = [3,3,3,1,1,2] That is, the most occurring values would be at the beginning of the list, while the values less occurring at the end. I've tried...
asked by 31.12.2017 / 21:54
3
answers

List with input in python

Good morning, people. I need help resolving some of the college exercise. The problem is relatively simple, but I'm having difficulties. My code is as follows: # Subprogramas def verifica_peso(pesos): if pesos > 10: print("A so...
asked by 06.04.2018 / 16:27
1
answer

Installing Django with Python3 [closed]

I got a project to do only with Python on v.3.4 + and I'm not getting Django running on non-2.7 versions. Does anyone know a link that teaches the whole installation of django in this new version of Python?     
asked by 21.06.2018 / 05:33
2
answers

Beginner - Unexpected behavior in a variable

I'm trying to create a code in Python that calculates the remaining value in my VR and alerts me if the average per day drops to 25. It's an attempt to understand better while and break. I created a variable for the total amount I get and one...
asked by 10.12.2018 / 18:32
1
answer

How to create a function to remove unwanted characters, anti injection

Hello, I searched the internet for the characters to remove, but the search did not answer my question .. So, I tried to know about anti-sqlinjection in python, but I did not find any way to do this by directly removing the characters when formi...
asked by 25.12.2018 / 00:03
3
answers

A register of people in python

I was trying to register a person with id , nome and idade , I created this code. The problem is in option 2 when show. I wanted to show it like this: print("nome",nome_pessoa,"idade",idade_pessoa,"id",id_pessoa) but the...
asked by 28.06.2018 / 15:37