Fix Python – How to exit from Python without traceback?

I would like to know how to I exit from Python without having an traceback dump on the output.
I still want want to be able to return an error code but I do not want to display the traceback log.
I want to be able to exit using exit(number) without trace but in case of an Exception (not an exit) I want the trace.
….

Fix Python – Showing the stack trace from a running Python application

I have this Python application that gets stuck from time to time and I can’t find out where.
Is there any way to signal Python interpreter to show you the exact code that’s running?
Some kind of on-the-fly stacktrace?
Related questions:

Print current call stack from a method in Python code
Check what a running process is doing: print stack trace….

Fix Python – Determine function name from within that function (without using traceback)

In Python, without using the traceback module, is there a way to determine a function’s name from within that function?
Say I have a module foo with a function bar. When executing foo.bar(), is there a way for bar to know bar’s name? Or better yet, foo.bar’s name?
#foo.py
def bar():
print “my name is”, __myname__ # <== how do I calculate t....

Fix Python – How to catch and print the full exception traceback without halting/exiting the program?

I want to catch and log exceptions without exiting, e.g.,
try:
do_stuff()
except Exception as err:
print(Exception, err)
# I want to print the entire traceback here,
# not just the exception name and details

I want to print the exact same output that is printed when the exception is raised without the try/except intercepting the e….