I know that the reccomended way to install Zope is with Buildout, but I can't seem to find a simple buildout.cfg to install a minimal Zope 2 environment. There are lots to install Plone and other things.
I've tried:
[buildout]
parts = zope
[zope]
recipe = plone.recipe.zope2install
eggs =
But I get:
An internal error occured due to ...
I just started using django for development. At the moment, I have the following issue: I have to write a page template able to represent different categories of data. For example, suppose I have a medical record of a patient. The represented information about this patient are, for example:
name, surname and similar data
data about cur...
This may be silly, but its been nagging the back of my brain for a while.
So Python gives us two built-in ways to delete attributes from objects, the del command word and the delattr built-in function. I prefer delattr because it I think its a bit more explicit:
del foo.bar
delattr(foo, "bar")
But I'm wondering if there might be und...
Say you are telneting into IRC to figure out how it all works. As you issue commands the IRC server returns data telling you what it's doing. Once I have created a default script that basically is how a normal IRC connection between server and client occurs, if it ever deviates from that it won't tell me what is wrong. I need to be ab...
Hello,
How i can make some improvement in my IRC client made in Python. The improvement is: How i can put something that the user can type the HOST, PORT, NICK, INDENT and REALNAME strings and the message? And here is the code of the program:
simplebot.py
import sys
import socket
import string
HOST="irc.freenode.net"
PORT=6667
NIC...
exepath = os.path.join(file location here)
exepath = '"' + os.path.normpath(exepath) + '"'
results = []
for e in ('90','52.62263','26.5651','10.8123'):
if e == '90':
z = ('0',)
elif e == '52.62263':
z = ('0', '72', '144', '216', '288')
elif e == '26.5651':
z = (' 324', ' 36', ' 108', ' 180', ' 252')
else:
z = (' 288', '...
Hi,
I was wondering if I could eliminate django session calls for specific views. For example, if I have a password reset form I don't want a call to the DB to check for a session or not. Thanks!
...
Hi,
I want to model an article with revisions in Django:
I have following in my article's models.py:
class Article(models.Model):
title = models.CharField(blank=False, max_length=80)
slug = models.SlugField(max_length=80)
def __unicode__(self):
return self.title
class ArticleRevision(models.Model):
article = ...
I've got a python script that loops indefinitely waiting for input, and then
does something when the input happens. My problem is then making python
tell emacs to do something. I just need some way to send emacs input
and make emacs evaluate that input.
Here's some code to illustrate my problem...
while(1):
on_off = query_lightswit...
To be more specific, I'm using python and making a pool of HTTPConnection (httplib) and was wondering if there is an limit on the number of concurrent HTTP connections on a windows server.
...
Hi,
I'm writing a RESTful API in Python using the restish framework. I would like to write some unit tests (using the unittest package, for example), that will make different requests to my application and validate the results. The unit tests should be able to run as-is, without needing to start a separate web-server process. How do I...
html5lib notes that it's latest release (0.11) is somewhat old. Using the Python portion, I have recursion problems as noted in Issue 70 and Issue 59 but can't find a recent Mercurial revision that is stable.
The latest tip is no good, I got the following error from python setup.py install:
byte-compiling build/bdist.linux-x86_64/egg/h...
I want keep track of a unique identifier for each browser that connects to my web application (that is written in Pylons.) I keep a cookie on the client to keep track of this, but if the cookie isn't present, then I want to generate a new unique identifier that will be sent back to the client with the response, but I also may want to ac...
Hi all,
I've got a django model that contains a manytomany relationship, of the type,
class MyModel(models.Model):
name = ..
refby = models.ManyToManyField(MyModel2)
..
class MyModel2(..):
name = ..
date = ..
I need to render it in my template such that I am able to render all the mymodel2 objects that refer to mymodel. Cu...
What is the equivalent list comprehension in python of the following Common Lisp code:
(loop for x = input then (if (evenp x)
(/ x 2)
(+1 (* 3 x)))
collect x
until (= x 1))
...
Example: It's really annoying to type a list of strings in python:
["January", "February", "March", "April", ...]
I often do something like this to save me having to type quotation marks all over the place:
"January February March April May June July August ...".split()
Those took the same amount of time, and I got 2x the # of mont...
I wanted to use the Python installed under cygwin rather than one installed under WinXP directly, so I edited ~/.bashrc and sourced it. Nothing changed. I tried other things, but nothing I did changed $PATH in any way. So I rebooted. Aha; now $PATH has changed to what I wanted.
But, can anyone explain WHY this happened? When do cha...
I'm wondering if Python has anything like the C# anonymous classes feature. To clarify, here's a sample C# snippet:
var foo = new { x = 1, y = 2 };
var bar = new { y = 2, x = 1 };
foo.Equals(bar); // "true"
In Python, I would imagine something like this:
foo = record(x = 1, y = 2)
bar = record(y = 2, x = 1)
foo == bar # true
The s...
I'm having trouble using python function decorators in Google's AppEngine. I'm not that familiar with decorators, but they seem useful in web programming when you might want to force a user to login before executing certain functions.
Anyway, I was following along with a flickr login example here that uses django and decorates a func...
I can't find a good clean way to lock a critical section in DJango. I could use a lock or semaphore but the python implementation is for threads only, so if the production server forks then those will not be respected. Does anyone know of a way (I am thinking posix semaphores right now) to guarantee a lock across processes, or barring ...