start zope with foreground debug messagesSOFTWARE: pythonzopectl fg Debug zope crashesChange directory to your zope instance's bin directory. For example on my setup this is:
Now fire up zope server with the fg (foreground) flag:
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 failureI had a problem with the cache directory for eggs not being writeable by zope. Fixed with this: MORE INFO: http://plone.org/products/documentation/error/permission-denied-python-eggstab NOT same as four spacesSOFTWARE: pythontextmate > view > invisibles Python IndentationPython 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:
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 or
MORE INFO: http://en.wikipedia.org/wiki/Python_syntax_and_semanticsphp print_r equivalent in pythonSOFTWARE: pythonrepr() 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:
So this is kind of like print_r in php. MORE INFO: http://docs.python.org/tut/node9.html |