Questions tagged as 'python-3.x'

3
answers

Next () in CSV Reader with Python 3

Hello, I'm doing a Machine Learning / Classification course and well it uses a CSV file in which one should ignore the first line of the file. Then I made the following code: import csv def carregar_acessos(): X = [] Y = [] arqui...
asked by 09.11.2017 / 01:00
1
answer

Replace words

I would like to know how to compact the lines of a txt. For example, the lines are broken by \n but are still part of the same sentence. SOCIAL HISTORY:Denies tobacco or alcohol use. PHYSICAL EXAMINATION: VITAL SIGNS: Age 34, blood...
asked by 14.11.2016 / 14:27
1
answer

In what order does a class inherit from its superclasses in python?

Be the code below: class B(A): def __init__(self): self.c = 16 def y(self): print("B.y") def get_c(self): return self.c class C(object): def __init__(self): self.c = 5 def y(self):...
asked by 18.02.2017 / 21:42
1
answer

Problems with python code in file i / o

Hello, I am new to python, I'm programming in 3.5.1, I was doing a piece of code that reads and then draws a line from a file: lista = {} # Essa função lê o arquivo e divide ele em linhas, em palavras e depois coloca dentro de um dicionario...
asked by 09.07.2016 / 14:10
1
answer

Function to mount query from table and add array to function

I'm trying to create a function where I need to send to it an array that goes with the same data as the sequence of the insert in the database but I'm not having any idea how to send that array into the function and mount the insert array exa...
asked by 22.01.2017 / 01:20
1
answer

Overwriting property () in the child class

A few days ago I asked a similar question, but the method used to create property was via decorators ( @property and @name.setter ). Here I am creating property via function property() : from abc import ABCMeta...
asked by 15.12.2018 / 14:41
2
answers

Accent error in Visual Studio output

print('Olá Python!) Here's some information on setting up my PC. Windows 10 Pro Cmder Active Code Page: 850
asked by 20.12.2018 / 14:50
1
answer

How to monitor changes in a folder?

How can I monitor and capture changes to folders and files? I intend to use this as part of a service that starts with the system the script would be in .pyw . example: if(mudou != padrao): pass But I do not know how I would do th...
asked by 08.09.2016 / 17:14
1
answer

Using recursion to count the number of times a number appears in a list

I have created a recursive algorithm to count the number of times a certain n appears in a ls list. It seems to work if the ls list is quite small (between 10 and 100), but if it is large, type 1000, it does not seem to work...
asked by 01.01.2016 / 01:27
1
answer

Problem comparing strings and string being broken in two python rows

I was creating a game that scrambles words, and the user has 6 attempts to guess what the word is. I'll put the code here: import random def main(): while True: input('Presisone enter para sortear uma nova palavra.') palav...
asked by 04.05.2015 / 14:50