code blocks in Python

F

Florian Reiser

Hi folks,

I have read your thread about code blocks.
When reading it, a problem that I have came to my mind.
I have a module ZReportLab. This module defines a class for Zope
(http://www.zope.org) for using the reportlab library.
The actual code I want the object to execute is stored in three string
variables, compiled at change time with compile()
and executed, when the object is called. So I can use a different content
code for each object I have created in the object database
of Zope.
But no one programs without errors, so every time I've made an error, I get
a traceback holding the information that there's an error,
inside my code object.
It would be nice if I could debug it with pdb. But at the moment I have to
guess where the error is, or step towards it, through inserting
a raise and trying if it runs to the position of the raise. This is really
hard work.
How can I compile my code object, so that I can debug it when I do the exec
codeObject?

Regards
Florian Reiser
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top