Questions tagged as 'python'

2
answers

End loop when an entry is empty

I have the following situation: A repeat loop that asks for a name, and 2 notes, where the data entry should finish when you read an empty name, but the way below the second time the program runs the name is not asked, any tips on how to do? n...
asked by 24.09.2017 / 17:58
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
2
answers

List entry with sequential search

I'm trying to create a variable entry function in a list that only allows you to enter terms not already contained in the list. I'm having difficulty finding a logical solution to this, I can not use break to stop the loop. I'm not making...
asked by 08.10.2017 / 20:36
1
answer

I want to save in a new txt file a copy of another txt in Python

arq = open("/Users/DIGITAL/Desktop/Python/novo.txt", "w") arq.write(palavras) arq.close() I'm using this code, but it only accepts string.     
asked by 09.10.2017 / 20:54
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

How to work with several codecs in pdf?

I have a set of more than 1,000 PDFs that I need to extract the metadata. The problem is that PDFs have different codecs. The first example worked, I used utf8 . The second example gave an error. It's Python 3 code: from pdfminer.pdfpars...
asked by 15.09.2017 / 20:30
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
1
answer

Transfer file to linux server with Python

Hello, I want to make a Python file that will transfer all files from a local folder of my Windows to a specific path on my CentOS 7 server >. At first this server is on my local network , but it would be interesting to make a transfer...
asked by 12.09.2017 / 21:12