Debugging a python routine
Can anyone suggest how I would go about debugging a Python routine like this through Zope? <span tal:define="opts python:here.lib.parse_file(file=here.members,sepr=',',clone=1)"> <tal:block repeat="opt opts"> <li><a tal:content="python:opt[1]" tal:attributes="href python:opt[0]"></a></li> </tal:block> </span> -- John
----- Original Message ----- From: "John Poltorak" <jp@warpix.org>
Can anyone suggest how I would go about debugging a Python routine like this through Zope?
<span tal:define="opts python:here.lib.parse_file(file=here.members,sepr=',',clone=1)"> <tal:block repeat="opt opts"> <li><a tal:content="python:opt[1]" tal:attributes="href python:opt[0]"></a></li> </tal:block> </span>
I would start by testing the python routine on its own (ie. without any ZPT stuff) to make sure it is producing what you expect, then add in the ZPT stuff bit-by-bit. Jonathan
John Poltorak wrote at 2005-6-27 16:45 +0100:
Can anyone suggest how I would go about debugging a Python routine like this through Zope?
It depends what type of object you want to debug, how much money you are ready to invest and how much comfort you need. At one endpoint is "pdb" (the Python debugger): * part of Python's runtime libary (no costs) * archaic user interface, (almost) without any comfort * after code changes able to debug trusted code (and untrusted Python Scripts once you used the appropriate "allow_module" and "allow_class") if Zope runs in the foreground. The code change is adding a import pdb; pdb.set_trace() At another endpoint is e.g. the commercial (!) WingIDE: * costs money, needs installation * comfortable, menu driven user interface * debugging of trusted code and untrusted PythonScripts * no code changes necessary -- Dieter
Dieter Maurer escribió:
John Poltorak wrote at 2005-6-27 16:45 +0100:
Can anyone suggest how I would go about debugging a Python routine like this through Zope?
It depends what type of object you want to debug, how much money you are ready to invest and how much comfort you need.
At one endpoint is "pdb" (the Python debugger):
* part of Python's runtime libary (no costs)
* archaic user interface, (almost) without any comfort
* after code changes able to debug trusted code (and untrusted Python Scripts once you used the appropriate "allow_module" and "allow_class") if Zope runs in the foreground.
The code change is adding a
import pdb; pdb.set_trace()
At another endpoint is e.g. the commercial (!) WingIDE:
* costs money, needs installation
* comfortable, menu driven user interface
* debugging of trusted code and untrusted PythonScripts
* no code changes necessary
Hi all! Dieter: can you send us some info about debug PythonScripts with WingIDE? All: WingIDE is free if you develop open source. Rencently I ask them for some licences but I can't demostrate I'm working on open source and they send me 2 180 days licences (I have windows and mac plataforms). If you can demostrate you are developing open source (they only ask for the project's url) they send you permanent licences Cheers -- Mis Cosas http://blogs.sistes.net/Garito/
Garito wrote at 2005-6-28 13:22 +0200:
... Dieter: can you send us some info about debug PythonScripts with WingIDE?
No, I cannot -- colleagues of mine use it (and are quite satisfied); I am using the archaic "pdb" :-) But, I am sure, you find information on the respective web site...
All: WingIDE is free if you develop open source.
Even better: download it and look at its documentation... -- Dieter
participants (4)
-
Dieter Maurer -
Garito -
John Poltorak -
Jonathan