Questions tagged as 'python'

0
answers

AttributeError: 'NoneType' object has no attribute 'fileno'

Good morning! I'm starting my studies on python-pandas, and I have a problem that seems like simple resolution. But not for me. Still. I'm following this tutorial: link I can create the dataframe, but when trying the command "df.loc [df.AAA...
asked by 20.12.2017 / 12:59
1
answer

Adjust Tkinter window and widjets according to screen resolution

Hello, I'm developing a python GUI with TKinter. I'm trying to make the widget setup I've set up to suit the monitor's resolution. I applied the following code. janela = tk.Tk() lado, cima = (janela.winfo_screenwidth()), (janela.wi...
asked by 20.12.2017 / 12:19
1
answer

Numpy dType complex, with fixed array of variables, using function fromfile to import binary file

I'm reading a complex binary file, where there is a fixed array of values, could anyone help? The structure is: 8 bytes = Long Current Time (unixtime stamp) 8 bytes = Long Current Time (unixtime stamp in MiliSeconds)...
asked by 20.12.2017 / 16:49
0
answers

Create Loop Script for a function

I'm pretty much a beginner in Python. I'm having a project to create a UDP chat in Python. I want to resolve an issue of creating an Online message. I typed the code but it is giving error. #! /usr/bin/env python #coding:utf-8 from twisted.in...
asked by 19.12.2017 / 01:23
0
answers

How to correctly read an API with JSON and create list?

In Python3 I made a program to read an API (from the Chamber of Deputies) and get the data in JSON import requests import pandas as pd url = 'https://dadosabertos.camara.leg.br/api/v2/deputados' # Primeiro eu fiz uma lista com dicionários -...
asked by 19.12.2017 / 13:56
1
answer

Cache \ Session in Python

I have a script in Python that runs a Tornado application. Within onmessage I have several variables that will keep an equal value always, so there is no need to fill them whenever a new message arrives for the Tornado. Currently I d...
asked by 19.12.2017 / 11:21
0
answers

Questions about Django MTV

I'm having a hard time understanding the Django concept. Please check if my design is correct: MTV refers to the Model Template View. Model would be my database. Template would be the interface displayed to the user (HTML, for example...
asked by 21.12.2017 / 19:17
1
answer

Type error: not all strings converted during formatting

I'm trying to make a couple or odd game. The problem is that every time the sum of my play with that of the computer gives 'par' this error message appears. I've tried other types of formatting and the same error always appears. Also, this line...
asked by 18.12.2017 / 01:22
1
answer

SQLite - Python - refer the table column in a loop

I'm doing a script in Python by accessing SQLite database. I made a For loop but I do not know how to get the value of a column in the table. See the example: cursor2 = cnx.cursor() cursor2.execute("select * from despesas") cursor2.moveToFi...
asked by 18.12.2017 / 21:05
1
answer

GPIO Pins RPi 3 Python

I'm starting with a project with my rpi 3 that concocts using engines connected to the gpio pins of rpi3! In my code there are some errors connected to the mode of the pins, but I do not know how to solve, SOMEONE COULD GIVE A HELP? import...
asked by 16.12.2017 / 13:54