I see advice on how to debug a python module that hangs up the process
JD
lists at webcrunchers.com
Tue Dec 16 18:37:22 EST 2003
On Dec 16, 2003, at 2:45 PM, Robin Munn wrote:
> The first step I'd suggest is to sprinkle print statements all around
> your code:
>
> print "About to call some_func()..."
> some_func()
> print "Returned from calling some_func()..."
>
> Then you can watch the console output (or redirect it to a file for
> later perusal) and see when the thing hangs.
We already know the function it hangs up at. It's a Python function
we defined.
Obviously, we put a print statement right at the beginning of the
errant
function, but it doesn't appear to be getting there.
IE:
print "before function call"
my_function(some_arguments)
print "after function call"
def my_function(some_arguments):
print "start of function call" <--- this never gets called, or
we don't see the output
<rest of code>
So when this piece of code is called, we get:
before function call
<system hangs up>
Then, we have to do a "kill -9" the process.
John
More information about the Python-list
mailing list