PHP as an Apache module or otherwise, would start one thread per pending request so it doesn't scale well.
Are Java and Python my only other options?
As a complete newbie to Python, is Twisted easy to use?
...
I'm using wxStyledTextCtrl from wxPython, a wrapper around the Scintilla component.
Is there any way to get alternate row coloring on it (odd rows in one background color and even rows in another color)?
I'm using the builtin python styler to highlight keywords.
...
I have a Django website in which I use django-tinymce to edit HTML fields with a TinyMCE control.
TinyMCE practically gives me a WYSIWYG way to edit HTML. My question is, can I get access to edit the underlying HTML directly? I was thinking, maybe there's some button I can enbale which will toggle between "WYSIWYG mode" and "raw html mo...
I'm trying to serialize obj using json (Python). I wish to skip json's unknown type
I know I can add my own encoder, but what I'm interested in is to just skip the unknown type. I don't want to use None instead. I have tried
icon=QIcon()
arr=["blablal",icon]
str1=simplejson.dumps(arr,skipkeys=True)
I used the skipkeys op...
Is there an easy way with python's logging module to send messages with a DEBUG or INFO level and the one with a higher level to different streams?
Is a good idea anyway?
...
Hello,
I have this superclass:
import wx
class Plugin(wx.Panel):
def __init__(self, parent, *args, **kwargs):
wx.Panel.__init__(self, parent, *args, **kwargs)
self.colorOver = ((89,89,89))
self.colorLeave = ((110,110,110))
self.SetBackgroundColour(self.colorLeave)
self.SetForegroundColour(se...
I am attempting to create a semi-dynamic aggregate function that will return the sums of all fields within a list. The assumption is that running get_query_set() will return a filtered query that contains all the fields in the list and some others that may not play so well with a Sum aggregate (date fields, char fields, Foreign Keys, etc...
Hi there!!
Friends!!! I am frustated since last five days working on implementing
reddit.com on a ubuntu 9.10 machine.
Yes, I know that reddit.com has been tested on ubuntu intrepid. But
now i want to install it on U9.10
I have installed postgresql database, created user copied the files,
and installed all the dependencies.
Everythi...
def createNode(doc_, **param_):
cache = {'p':'property','l':'label','td':'totalDelay','rd':'routeDelay','ld':'logicDelay'}
for index in param_:
newIndex = cache[index]
value = param_[index]
print newIndex, '=', value
doc = 10
createNode(doc, p='path', l='ifft4k_radix4_noUnolling_core.vi', td='3.0', ld='...
I need to read a large XML (65 Mb), validate it against a xsd, and run XPath queries on it. Below, I've given an lxml version of that. It takes a lot of time (over 5 minutes) to run the query but validation seems to be pretty quick.
I've a couple of questions. How would a performance minded Python programmer write the program using lxm...
I am writing a general Client-Server socket program where the client sends commands to the Server, which executes it and sends the result to the Client.
However if there is an error while executing a command, I want to be able to inform the Client of an error. I know I could send the String "ERROR" or maybe something like -1 etc, but th...
Hello,
I have this code:
import wx
class Plugin(wx.Panel):
def __init__(self, parent, *args, **kwargs):
panel = wx.Panel.__init__(self, parent, *args, **kwargs)
self.colorOver = ((89,89,89))
self.colorLeave = ((110,110,110))
self.colorFont = ((131,131,131))
self.SetBackgroundColour(self.colo...
I noticed in the django documentation that when DEBUG is False it will mail your configured ADMINS the full exception information.
Is there an easy way to dump the full exception information this to a file?
...
So let's say you've got an application with a variable that you will be creating an instance of when you load it independently (ie when you use if __name__ == '__main__').
Also, there is a method that is to be called for when a client imports the application for use within another application. This method will also instantiate this v...
I wrote a tool for find dependency relationships behind a Python project. It is Gluttony. I run it on Plone, the result is impressive. I output the diagram with Networkx, and it looks like this:
(Gee! It looks like World of Goo!)
A mess! I didn't handle layout with Networkx. That's why it is a mess. The tool can output Graphviz f...
I want to make attributes of GAE Model properties. The reason is for cases like to turn the value into uppercase before storing it. For a plain Python class, I would do something like:
Foo(db.Model):
def get_attr(self):
return self.something
def set_attr(self, value):
self.something = value.upper() if value != None...
What does Django do with MEDIA_ROOT exactly? I never understood it. Since Django itself doesn't serve static media, and you have to set up apache or something similar for it, why does it care in which directory it sits?
...
In Python, which is the best way (style wise) to allow public access to an object's variables?
There are lots of options I've seen from different languages, I was wondering which of these (if any) is the preferred Python method? These are the options I'm currently torn between:
Allow direct access to object variables (e.g. print(objec...
I need to install a python module in the site packages that also will be used as a command line application. Suppose I have a module like:
app.py
def main():
print 'Dummy message'
if __name__ == '__main__':
main()
setup.py
import distutils
try:
from setuptools import setup
except ImportError:
from distutils.core imp...
hi i am using the following models to build a database
from django.db import models
from django.contrib import admin
class Team(models.Model):
"""Model docstring"""
slug = models.SlugField(max_length=200)
Team_ID = models.AutoField(primary_key=True)
Team_Name = models.CharField(max_length=100,)
College = models.Ch...