Reputation: 1953
I have a python script that occasionally freezes and I'd like to find out why? Is there a way to hook into a python script and see what the variables are what line its on and/or what its doing?
Upvotes: 13
Views: 4724
Reputation: 26766
Use a debugger as shown in the answers to How do I attach a remote debugger to a Python process?
Once attached, you can pause execution and examine variables, the current stack, etc...
As pointed out in the comments, the linked debuggers apparently require the process to be launched in a particular manner. Visual Studio (With Python Tools installed) does support attaching to a running process.
Upvotes: 1