I've written this small app that draws lines between two points selected by the user and it works but how do I keep the lines I draw from disappearing whenever the window is minimized or gets covered by another open window?
class SimpleDraw(wx.Frame):
def __init__(self, parent, id, title, size=(640, 480)):
self.points = []
wx....
Hi,
I'm pretty new to Python, and programming in general and I'm creating a virtual pet style game for my little sister.
Is it possible to run 2 while loops parallel to each other in python?
eg:
while 1:
input_event_1 = gui.buttonbox(
msg = 'Hello, what would you like to do with your Potato Head?',
title = 'Main Scr...
I'm writing a Django admin action to mass e-mail contacts. The action is defined as follows:
def email_selected(self,request,queryset):
rep_list = []
for each in queryset:
reps = CorporatePerson.objects.filter(company_id = Company.objects.get(name=each.name))
contact_reps = reps.filter(is_contact=True)
...
What is the best JSON library to get JSON data for Django, 'simplejson' or otherwise?
thanks very much
...
I am using urllib.urlretrieve in python to download websites. Though some websites seem to not want me to download them, unless they have a proper referrer from their own site. Does anybody know of a way I can set a referrer in one of python's libraries or a external one to.
...
Hi, I'm a Matlab user needing to use Python for some things, I would really appreciate it if someone can help me out with Python syntax:
(1) Is it true that lists can be indexed by tuples in Python? If so, how do I do this? For example, I would like to use that to represent a matrix of data.
(2) Assuming I can use a list indexed by t...
So I'm building a Django application,
and these are a few models I have:
class MagicType(models.Model):
name = models.CharField(max_length=155)
parent = models.ForeignKey('self', null=True, blank=True)
class Spell(models.Model):
name = models.CharField(max_length=250, db_index=True)
magic_words = models.CharField(ma...
I need to find all sub-arrays which share any mutual element and merge them into one sub-array.
(Implementing in Python but any algorithmic idea would be helpful)
Multidimensional array structure:
categories = {'car':['automobile','auto'],
'bike':['vehicle','motorcycle','motorbike','automobile'],
'software':[...
I'm working on an App Engine project that will have customizable themes. I'd like to be able to use jQuery UI themes. The problem is figuring out what the CSS file is going to be named. (Typically, "jquery-ui-1.7.2.custom.css". Version numbers will change, and people tend to rename things, but there should only be one CSS file, and I...
I'm new to Django and am still trying to break old PHP habits. Below are two models. To make things confusing they live in separate files, in different apps...
#article.models
from someapp.author.models import Author
class Article(model.Model):
...
author = models.ForeignKey(Author)
# author.models
class Author(model.Model):
...
I'm using an ifequal tag in my django template inside a loop where atleast one of the items should equal the other at some point in the loop but for some reason it never displays what it should. I was wondering if there are any weird cases that i should know about.
I have a list of int city ID's that should be checked as check boxes. so...
1)I want to devlop a website that has forums and chat.The chat and forums are linked in some way.Meaning for each thread the users can chat in the chat room for that thread or can post a reply to the forum.
I was thinking of using django for forums and twisted for chat thing.Can i combine the two?
The chat application devloped using twi...
django view:
def json_view(request):
import json
tag=request.GET.get('tag')
if tag=='userName':
username=request.GET.get('userName')
result='successName'
if username:
try:
user=User.objects.get(username=username)
result='existName'
except User.Do...
Hi!
I read about the problems with CPython and CPU bound threads and the GIL and some changes in Python 3.2.
Do IronPython and Jython have this same problem?
Thanks
...
while i am creating each child frame it is visible as tabs in parent frame
i need each child frame has a title bar minimize button and close button
how can i achive it?
also
I need to check whether a child window is already exists or not
to avoid duplicate windows
thankz in advance
...
I have a list if these 3 items: title and link and a html based description and I am looking for a library or external tool which can be fed these 3 items and create a rss xml page. Does such a thing exist?
...
For our webservice, I wrote some logic to prevent multipart/form-data POSTs larger than, say, 4mb.
It boils down to the following (I've stripped away all WebOb usage and just reduced it to plain vanilla WSGI code):
import paste.httpserver
form = """\
<html>
<body>
<form method="post" enctype="multipart/form-data" action="/">
<in...
from functools import wraps
def a():
a='aa'
def b():
b="bbb"
c=wraps(a)(b)
print c#what happen?
what is the wraps mean,example is the best.
thanks.
...
I'm using the Python client library for the Picasa Web Albums API to upload some JPEG images to an album. But the photos appear very compressed once uploaded. In Picasa 3.6 there is an option to upload images in their original quality without any compression, but is there are similar option I can use from within the API?
This is some of...
In django.utils.translations.__init__.py:
def ugettext(message):
return real_ugettext(message)
I can't find it.
...