# Put this with your import statements
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = 'all'
# ----------------------- Example -------------------------
from sympy import *
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = 'all'
f = exp(x**2);#f
df = diff(f,x);#df
# ------------------------- Output --------------------------
f
df