Questions tagged as 'python'

1
answer

Game Snake in pygame: Snake growth function [closed]

I'm writing Snake in pygame, but I do not have a very clear idea of how to implement the snake's growth functionality. I made a list ("list_cobra") containing the coordinates of the head (which is approximately 30x30 pixels), and I thought of ma...
asked by 25.09.2016 / 17:34
1
answer

What if I do not want any queryset in a Django view?

There are urls that I just need to set a session or consult a restful API ... anyway. What if I do not want a queryset? Why does django seem to force me to define one? Would you have some kind of different view for this?     
asked by 16.12.2016 / 17:40
1
answer

Creating an ARPING

#!/usr/bin/python3 #Fazer arping de conexao import sys from datetime import datetime from scapy.all import * try: interface = input ("\n[*] Set interface: ") ips = input("[*] Set IP RANGE or Network: ") except KeyboardInterrupt: pri...
asked by 13.08.2016 / 00:59
1
answer

Error Django csv

Well, I'm having a problem reading csv and entering the data. I believe it's in the foreign key. The code is: View: def csvAih(request): coluna = 1 mes = 1 ano = 2008 while (ano < 2017): with o...
asked by 13.09.2016 / 00:48
1
answer

Many to Many WTForms Flask SQLAlchemy

Good evening! I am implementing a system with wtforms flask , and stopped in the following situation: I have CRUD products and a CRUD Budget so I will have product items in the budget (n: n). In surveys I've done only with example "SelectFie...
asked by 05.08.2016 / 05:37
1
answer

How to print an element from a list each time a particular method is called?

I'm trying to make a math expression game in python, but I need my MandaExp method to return an expression every time it's called. In this method I have a list called explist, where several expressions are organized according to the selection of...
asked by 31.07.2016 / 23:39
1
answer

Python - API 2.0 Zenvia - urllib.error.HTTPError: HTTP Error 400: Bad Request

The software below has the following intent: extract data from an excel .XLS file and send SMS with information extracted through the Zenvia platform. Here is the Zenvia Platform 2.0 API link: link import re import urllib.request import x...
asked by 19.07.2016 / 21:12
1
answer

sqlalchemy error 1044

I have a Python application that connects to a Mysql database through Sqlalchemy, but I did not develop it. When migrating the database to another server (aws.rds ⇢ go daddy), I changed the connection to the new server and apparently the dat...
asked by 09.08.2016 / 04:22
1
answer

Problem with using QPixmap.scaled

Recently I'm learning to use PyQt4 , but I've had a question about using the line of code to modify the scale of an image: class Ui_Form(object): def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.res...
asked by 20.06.2016 / 18:55
1
answer

sqlite3.OperationalError error

I'm having a problem with sqlite3 in python, can anyone help me? The error is this: :~$ python3 05_create_data_param.py Nome: Henry Elias Carlos Eduardo dos Santos Usuário: Henry94 Senha: mGq0HJAM2C Data de nascimento: 08/01/1994 CPF: 772.0...
asked by 10.06.2016 / 12:51