import code; code.interact(local=locals())IPython with embed()
Install it with:
pip install ipythonUse it like so:
from IPython import embed
# Misc code
embed() # this will drop us into IPython
# Misc codeAlthough you can use it directly as well:
import IPython
x = "foo"
print(x)
IPython.embed()
x = "bar"
print(x)