For showing the stack trace from a running Python application you can follow the below-mentioned steps:-
The first and most effective way to overcome this problem would be to install a signal handler.
Sometimes you need to debug a process that I didn't have the foresight to install the signal handler in some of the os like, for Linux, you can attach gdb with the process and get a python stack trace with some gdb macros.
For getting the gdb to use the following link:
http://svn.python.org/projects/python/trunk/Misc/gdbinit in ~/.gdbinit, then: