Questions tagged as 'python'

1
answer

Send or update button in Tkinter (Python) and Widget Resizing

Start a code in which you have 4 ChecksButtons and I wanted to do the following: (pseudo-code) user types the name of the database, and selects what he wants = > name, email, cpf, color after that the program picks up and verifies which is se...
asked by 16.05.2017 / 02:38
1
answer

Problem in understanding this structure in a python string

I was studying file compression when I came across the following script: import sys import os.path import bz2 import zlib import base64 ################################################################################ def main(): "Extract...
asked by 27.03.2017 / 18:34
1
answer

Compare dates in an array?

In the variable dates, you are receiving several dates in string as array , I want to bring the smaller cont = 0 menor_data = datetime.strptime('31/12/2300', '%d/%m/%Y') while cont < len(datas): data_d = datetime.strptime(d...
asked by 27.03.2017 / 01:20
1
answer

Scheduling Tasks in Django

Galera is as follows, in Django things only happen when some user accesses your application. AN EXAMPLE ) Let's say you've created an application where the user logs in and writes little reminder texts, more or less like a post-it, for...
asked by 12.05.2017 / 15:21
2
answers

Analyzing strings in a text file and returning the string that most appeared

I need to parse strings into a text file and return the one that pops up (if there is a draw, take both) and save it to another text file. I open the file and I analyze the lines but I do not know how to check what else appears. Example: file...
asked by 10.05.2017 / 23:01
1
answer

REGEX to Select a line containing a drawn string

I would like to select a whole line that contains a desired string. For example: String: "BLUE LED should light" text: When pressing the button the BLUE LED should light for 5 seconds according to the test characteristics. I would li...
asked by 07.03.2017 / 15:41
1
answer

Compare all rows and columns of two Dfs, update and sum the differences at the end of rows and columns

I have two csv separated by tab. Both have the same number of rows and columns. The first column POS has the same unique values in both dfs. The differences (or not) occur in the values (strings) of columns col1:col4 . I thought...
asked by 08.03.2017 / 14:40
1
answer

Manipulation of columns with pandas

I'm running a regression where I have 3 parameters and a column with categories. As sklearn does not recognize categories I transform them into dummies (I create a column for each category and fill it with 1 case belongs to the column categor...
asked by 19.05.2017 / 03:31
1
answer

List only files without folders in directory in Python

I need to list files in a directory, but I need to list only the files, without showing any folder if you have that directory. I used: import os print os.listdir('/')     
asked by 24.04.2017 / 19:42
1
answer

Web scraping on a specific url with BeautifulSoup

from bs4 import BeautifulSoup import requests import re url = 'http://www.bhaktiyogapura.com/2017/03/calendario-vaisnava-marco-de-2017/' header = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) ' 'AppleWebKit/537...
asked by 11.03.2017 / 13:14