I have a wx app that I would like to actively debug (even after it is compiled via py2exe). Is there a way to hook all methods(without having to manually add code to each one) and have it print their names' as they execute. I've looked into both the "inspect" and "pdb" modules and have a very limited understanding of both.
Second question, is it possible to change a functions code "on the fly." ie afunction.func_code.co_code = "some compiled code". I'm just not sure how to compile the source.
-Thx
ihatehippies
11
Junior Poster
Recommended Answers
Jump to PostI have a wx app that I would like to actively debug (even after it is compiled via py2exe). Is there a way to hook all methods(without having to manually add code to each one) and have it print their names' as they execute. I've looked into both the "inspect" …
Jump to PostYou can use decorators, or you can use metaclasses to decorate all the methods in a class.
Then you can make the decorator modify each function on the fly.
All 17 Replies
Gribouillis
1,391
Programming Explorer
Team Colleague
jcao219
18
Posting Pro in Training
ihatehippies
11
Junior Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
ihatehippies
11
Junior Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
ihatehippies
11
Junior Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Gribouillis
1,391
Programming Explorer
Team Colleague
ihatehippies
11
Junior Poster
ihatehippies
11
Junior Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
ihatehippies
11
Junior Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
ihatehippies
11
Junior Poster
ihatehippies
11
Junior Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.