how to include a tiny debug feature in my project ?

Stef Mientki S.Mientki-nospam at mailbox.kun.nl
Thu Dec 13 11:46:21 EST 2007


hello,

I've large program based, with a GUI based on wxPython,
where the user can add small parts, which I call Bricks.
A new Brick is created by inheriting from the standard-Brick.
The user should only override 1 or 2 functions from the standard-Brick.
The main properties used in those 2 functions have fixed names.
Now I've not a good idea, how I should debug that new-Brick.

Because I don't want to crash the program,
by bugs in the new-Brick,
I put the call to the overriden functions in new-Brick in a try-except statement.
So it won't generate errors,
and besides that,
debugging GUI is a crime,
and I certainly don't want the user to digg into the large program.

So I'm thinking of another approach:
- locate the 2 functions of the new-Brick
- execute them line by line through a exec-statement
- give a print statement of the most important parameters,
after the execution of each line
(The number of lines written by the user will be at most 20 lines)

Is this a good approach ?
If so, how can I execute each line separate ?
If not, what other approach should I use ?

thanks,
Stef Mientki






More information about the Python-list mailing list