Questions tagged as 'python'

1
answer

Custom window different from the default in python

Hi, I would like a Python window example, other than the default one, how do I do this ??? This is my code: from tkinter import = root = Tk() theLabel = Label(root, text="This is too easy") theLabel.pack() root.mainloop()     
asked by 16.02.2016 / 09:18
2
answers

How to insert query result in mysql with python

I need to insert in the database the result of this query through the temperature module. The code is this. Temperature and humidity are already returning, but the values are not saved in the database. # Carrega as bibliotecas #!/usr/bin...
asked by 16.02.2016 / 19:15
1
answer

Problems installing numpy module on windows by pip

I can install other modules using pip , except numpy . I have already tried other forms of installation using easy_install and installation by src , unsuccessful too. Look at the output of the installation attempt wit...
asked by 11.10.2015 / 13:17
1
answer

Assigning Values to Dynamic Variables

I'm trying to write a code that downloads the historical stock price series of yahoo finance , then I need to separate the data. I want each variable to get the name of the action. For example: I am downloading the data from Petrobras, so I...
asked by 02.11.2015 / 22:02
1
answer

How to get the contents of the selected cell in the Grid QTableView in Python?

How can I get the content of the cell selected in a Grid of type QTableView in Python ? Here is the code below: __author__ = 'Dener' from PyQt4.QtCore import * from PyQt4.QtGui import * import sys class Model(QAbstractTableModel...
asked by 02.09.2015 / 01:01
1
answer

Variable with multiple lists for array

Good evening. I have a text file where I have already converted your content to lists. Each line of the file has become a [] list, but now I need those lists all to be inside an array. This way I can not concatenate because there is only one var...
asked by 16.10.2015 / 03:30
1
answer

Problem with IF / ELSE and variables

I started to study Python very soon, and created the following code: gene = open("AY365046.1.txt","r") g=0; a=0; c=0; t=0; gene.readline() for line in gene: line = line.lower() for char in line: if char == "g": g...
asked by 14.08.2015 / 10:04
1
answer

SyntaxError when unpacking elements of iterables

line = 'nobody:*:-2:-2:Unprivileged User:/var/empty:usr/bin/false' uname, *fields, homedir, sh=line.split(':') print fields I was doing studies in Python and I'll deal with the line so, when trying to compile I get the following message Synt...
asked by 04.12.2015 / 12:14
1
answer

How to clean the screen in TkInter?

Is there a practical way to "clean" a screen, giving destroy() to all widgets at a time, without having to do this one-by-one?     
asked by 05.08.2015 / 16:15
1
answer

python request iugu returns status 400

I'm testing the iugu.com api to generate ticket payments and I'm having problems with json's return because there is no error in dictionary items which is sent to the API (in php would be an array) The code is as follows: from flask impor...
asked by 11.09.2015 / 18:48