start zope with foreground debug messages

SOFTWARE: python

zopectl fg

Debug zope crashes

Change directory to your zope instance's bin directory. For example on my setup this is:

cd /var/opt/zope/default/bin

Now fire up zope server with the fg (foreground) flag:

./zopectl fg

This will fire up the zope server and also spit out messages to your terminal window telling you what's going on. Critical for debugging failures on start up.

eggs cache directory failure

I had a problem with the cache directory for eggs not being writeable by zope. Fixed with this:

fix eggs dir problem


tab NOT same as four spaces

SOFTWARE: python

textmate > view > invisibles

Python Indentation

Python is sensitive to whitespace. Tabs are not the same as four spaces. Don't mix the two in your code or you'll get bugs. If you get this error:

IndentationError: unindent does not match any outer indentation level

then you know you've got something indented incorrectly in your code. I found that viewing invisibles in textmate (or whatever text editor you're using) is very helpful.

textmate > view > invisibles


OPT CMD I (key combo)

php print_r equivalent in python

SOFTWARE: python


To get at the structure and contents of an array in python you can use:


For example, if you have an array "crumb" which stores information about URL and Title for a given page:


Might give you something like:

{'absolute_url': '', 'Title': 'Page Title'}

So this is kind of like print_r in php.