Questions tagged as 'python'

1
answer

Find the index of a certain value in a list in Python [duplicate]

I'm doing a function to count the words of a text without repeating them and with that, I also need to count how many times it appears inside this list of strings I used the code below but it does not work, I can not get the position of the wo...
asked by 11.06.2017 / 22:39
1
answer

Problems with the While repetition structure

I'm trying to create a program based on the% rewrite structure, but the loop does not end. sexo = str(input('Digite seu sexo:')) if sexo != 'M' or sexo != 'F': while sexo != 'M' or sexo != 'F': sex = str(input('Digite seu sexo:'))...
asked by 21.11.2017 / 18:08
1
answer

IDE for django? [closed]

Good evening, guys, I'm having a lot of problems with some ides, and I need your advice. I'm trying to program web projects in python, so I installed pycharm to work ... The beginning is a great IDE, but it seems that the world neither makes use...
asked by 17.08.2017 / 03:20
1
answer

Automate reading of multiple text files in a Python script

I have a Python script that counts the number of connections contained in a text file and is working perfectly: with open('1zao.txt') as f: linhas = f.readlines() soma = 0 for linha in linhas: soma += int(linha.strip().split(" ")[0])...
asked by 10.07.2017 / 15:28
1
answer

Creation of empty csv

Hello about the python code below, I want to create a csv with the sum of inhabitants in each state but it creates an empty csv file Please, does anyone have an idea of the problem? The original csv file I searched for is the followi...
asked by 24.07.2017 / 17:32
2
answers

returning indexes of python lists

I'm having a problem with the index line because it does not accept float . But how can I do to get around this? def median(numbers): numbers.sort()#The sort method sorts a list directly, rather than returning a new sorted lis...
asked by 24.07.2017 / 17:25
3
answers

How to store an int and a complete string from within an input?

I want the keyword "2 orange juice" in the variable N to store the number and : number = 2 (preferably integer, but anything I convert it after) food="food juice" The code is below and went as far as I could get: suco_laranja = "...
asked by 31.05.2017 / 18:47
1
answer

Error executing program in python [closed]

I made this program in python: //////////color.py #!/usr/bin/env python # -*- coding: utf-8 -*- class Color(object): string = { "RED": "\x1b[31m", "GREEN": "\x1b[32m", "BLUE": "\x1b[34m", "YELLOW": "\x...
asked by 04.08.2017 / 10:43
1
answer

How to save images to a server folder via sockets using python and opencv?

Hello, I'm new to programming and would like to know how to save images, (captured by opencv) in a folder created by the code inside the server, I know how to do this with the sockets but I have no idea how. the code below captures the face creat...
asked by 07.04.2017 / 18:05
1
answer

Tkinter (Python) Windows Management

I'm doing a code in which the main window has 4 buttons (Create, Manage, Delete and About) and I wanted the time I clicked the button to create isse for the creation tab without having to open another window (Stay two windows) or close the main...
asked by 16.05.2017 / 01:31