Questions tagged as 'python-2.7'

1
answer

AttributeError: 'Directors' object has no attribute

I'm trying to get a value from a very simple class, but I have a problem that I can not solve. Here are the codes below: Main class: from directores.directores import Directores # A classe Directores encontra-se em directores/directores.p...
asked by 26.09.2018 / 05:39
1
answer

Doubts Python libraries [closed]

Good afternoon! I'm new to development using the Python language, I'd like some tips from good libraries to be studying and especially one to "manipulate sites" (currently I only know Selenium WebDriver, but I'd like to know others), I know is...
asked by 27.09.2018 / 17:53
1
answer

Manipulation and grid, hbox and vbox in pyqt4

I'm a beginner and I'm making a graphical interface with the help of pyqt4. I need to add two columns of buttons where there is only one, but every time I try, the button goes to the right and spoils the proportions. Can anyone help me? What...
asked by 21.10.2018 / 04:21
1
answer

Installation geopy python 2.7

I have python 2.7.12 installed on my computer (ubuntu 16.04) and installed geopy (1.11). But when I try to run my script, this error appears: from geopy.distance import lonlat, distance ImportError: cannot import name lonlat Someone kn...
asked by 06.09.2018 / 11:41
1
answer

How to generate condition of interruption of a repetition loop in Python during its execution?

I'm trying to make a program in Python that while executing a loop loop, some command is waiting for an input condition while the loop is executed. For example, a program that prints on the screen numbers, in ascending order and every 1 sec...
asked by 26.07.2018 / 18:29
1
answer

Draw vertical line centered on image [closed]

I'm working with Python image processing using the PIL and Matplotlib library and I'm not succeeding for the following purpose: I have the image below. Iwouldliketodrawaverticalandcentralizedline,asshownbelow: I have tried several ap...
asked by 14.07.2018 / 06:07
1
answer

NameError when entering the value read by the input function

I'm running Python version 2.7: Python 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609] on linux2 When I try to run this line of code : x = input('Enter your name:') print('Hello, ' + x) I have the following error: $ pyt...
asked by 18.08.2018 / 00:23
1
answer

What is the Python function equivalent to Crypt in PHP

I have a program in PHP that encrypts a password with the crypt method: $crypt = '$1$/E0xe3/3$yPzJElk.aVSd5JoQTopDZ/'; if($crypt == crypt($_POST['key'],$crypt)) And with that I generate the following hash of this password: *...
asked by 07.08.2018 / 20:39
1
answer

Increase Spirograph loop speed in turtle

Using these references: Spirograph Patterns and python 3.4 spirograph error The following code was created: Code import turtle import math import random def Xcord(R,r,p,t): return (R-r) * math.cos(t) - (r+p) * math.cos((R-r)//r*t)...
asked by 04.07.2018 / 19:42
1
answer

Select the two largest values of a vector and add them?

atletas = [] while True: nome = input("Nome: ") if not nome: break saltos = [] for i in range(3): salto = float(input("Distância {}: ".format(i+1))) saltos.append(salto) atletas.append({ "nome": no...
asked by 12.06.2018 / 23:24