Questions tagged as 'python'

1
answer

Coordinates of a PyGame image

How can I get the x and y coordinates of an image in PyGame? I need this for a game where I have to get the shot right out of an enemy. Here is the code: # -*- coding: cp1252 -*- import sys import random import pygame print pygame.init() #ini...
asked by 25.09.2015 / 21:31
1
answer

Single Email field in Django User model

I have a system that has a user registry and I'm using the lib django.contrib.auth.models to do this registration. But I I need the email field of this model to be unique. from django.db import models from django.contrib.auth.models imp...
asked by 13.04.2015 / 20:29
2
answers

Does NetBeans support Django?

I installed NetBeans and the python plugins . Everything worked fine, but I found the one that did not happen. This plugin alone would already support Django. I saw on this blog the author saying that I like NetBeans also for Django,...
asked by 27.04.2015 / 06:15
1
answer

Understanding the permissions system of Django 1.7

I have an app called forms_and_models that I use for study. In the Django 1.7 documentation says:    Assuming you have an application whose app_label is foo and a template called Bar , to test basic permissions, you should use: to...
asked by 01.03.2015 / 14:54
2
answers

Error in the Python-docx module in Windows

I'm using the following code: from docx import Document d = Document(open("arquivo.docx")) This code works on Ubuntu but does not work on windows. In windows I have the return in the terminal:    Traceback (most recent call last):    ...
asked by 02.02.2015 / 13:59
1
answer

What tools do you use to create web games? [closed]

I would like your help on the following questions: 1. What is the best option for web game development? 2. HTML5 with Canvas, Javascript and PHP? What do you think of this combination? 3. Is Python an option? I'm really unsure...
asked by 02.12.2015 / 19:25
1
answer

Image Manipulation - Condition of "image [CONDITION]"

I'm working with Python image manipulation. I came across a line of code like: image[dst > 0.01 * dst.max()] = [0, 0, 255] Being "image" and "dst" images. What's inside the brackets "[]", indexing "image" is a condition for the pi...
asked by 25.10.2014 / 01:55
1
answer

Differences between RCurl, httr (R) and requests (python) when doing a POST

I was looking to access a page that you get by clicking "View all documents above" in that link . The company I got is just an example, I have no interest in it. I tried to resolve this through a POST request, and I got the result I wanted u...
asked by 10.10.2014 / 21:13
1
answer

Query by time interval in mongodb using pymongo

I need to perform a query on a mongodb database that results in one result set per time range. I'm using pymongo. My query looks like this: queryConsulta = {"$and": [ {"id_no": id_node}, {"porta": porta...
asked by 14.10.2014 / 04:31
1
answer

What is the best way to split a Django project into apps?

I'm doing a project as a study to apply what I've learned so far with Django. My question is: what is the best way to target the project in apps ? If you want to give an example so that something empirical is captured, let's say the project is...
asked by 12.03.2015 / 22:30