Instead of printing, consider using module memory_graph to graph the recursion. A simple example for a factorial() function looks like:
import memory_graph # see link above for install instructions
def factorial(n):
if n==0:
return 1
memory_graph.show( memory_graph.get_call_stack(), block=True )
result = n * factorial(n-1)
memory_graph.show( memory_graph.get_call_stack(), block=True )
return result
print(factorial(3)) # 6
Full disclosure: I am the developer of memory_graph.