Questions tagged as 'python-3.x'

1
answer

Problem instantiating classes in Python 3 [closed]

When I run my program test.py : debug returns me    object () takes no parameters '' on line 4 from tatu2 import Cliente from tatu2 import Conta joao = Cliente('João da Silva', '777-1234') maria = Cliente('Maria da Silva', '555-432...
asked by 27.10.2017 / 02:18
1
answer

Equivalent to the "console.dir ()" function in Python

Is there a function in the Python language (v3.6) to display attributes and methods of an object, such as console.dir() in JavaScript? I'd like to get output similar to console.dir in web browsers. The dir function of Py...
asked by 21.11.2017 / 01:11
1
answer

can only concatenate list (not "str") to list

Hello, I'm new to python and I'm probably programming with a problem that should be very conceptual. I made this code to read a numeric sequence in a txt and rename it with the string found. name_files3 = os.listdir(path_txt) for TXT in name_...
asked by 30.11.2017 / 13:45
1
answer

Error to use np.concatenate

I'm doing a mergesort using the numpy library. It turned out that it was giving error. in the line "np.concatenate (result, left [i:])" there in merge function. The error is this: /sorts/main.py", line 30, in merge np.concatenate(resultado,esq...
asked by 10.10.2017 / 23:31
2
answers

python vector input

I have some input values of an array that will have the input of the following form: 1 2 3 4 2 3 4 0 So I'm trying to get the first row of m + n elements to turn everything into float, but it's not working. aux = [0]*(m+n) for i in r...
asked by 22.09.2017 / 20:53
2
answers

TypeError: CalculateSalary () missing 1 required positional argument: 'Title'

When trying to create a simple code in Python and I came across the following error in the method of calculating salary    TypeError: CalculateSalary () missing 1 required positional argument: 'Title' class Professores(): ID = 0 No...
asked by 10.10.2017 / 00:53
1
answer

How to open different web pages using the while

I would like the program to execute a command three times: wait 10 seconds to open a web page. For this to occur, set the following code: import time import webbrowser total_breaks = 3 break_count = 0 while(break_count < total_breaks):...
asked by 26.09.2017 / 21:11
1
answer

How to use functions that are in a different file? - Python

I have a problem using functions that are in a different file than the location where I am calling these functions. Basically my project is organized as follows: Lista_I (Pacote Contendo os Arquivos) __init__.py funcoes_uteis.py PD...
asked by 15.09.2017 / 22:26
1
answer

Exchange pointers list chained - python

I created a function to change the pointers of a linked list, the idea is very simple, I change them and update the next element so it does not lose the reference, but the function is losing the reference, eg, I tried a list l = 1, 2, 3, 4, 5, 6...
asked by 15.10.2017 / 18:46
1
answer

Tuples: index out of range - recursion

I'm having a problem with index out of range in my tuple. The purpose of the code is to create a recursive function that finds a substring within a tuple with elements of any type. Could someone help me with this error? The problem i...
asked by 06.09.2017 / 02:59