print python stack trace without exception being raised
traceback.print_stack(): >>> def f(): … def g(): … traceback.print_stack() … g() … >>> f() File “<stdin>”, line 1, in <module> File “<stdin>”, line 4, in f File “<stdin>”, line 3, in g Edit: You can also use extract_stack, take a slice (e.g. stack[5:] for exclude the first 5 levels) and use format_list to get a …