The standard approach is to use a profiler. If for some reason you cannot (for example, there is no profiler available in modpython Apache that runs your Django), your best option might just be your logging tool. View messages from your program and see what you can learn from them.
If you see the message βInput CalculateFoo ()β and then five seconds later βExiting CalculateFoo ()β, this is the main key. Or, if one particular function continues to print over and over.
Here's a short discussion of the Python log.
Python Debugging Tips
EDIT: I just noticed that you specifically said that this is on the Windows 7 desktop. So, use a profiler. But I will leave this answer to cover the general case.
steveha
source share