Ich wollte Rubys binding.pry
auch in Python machen.
# coding: utf-8
from IPython import embed
from IPython.terminal.embed import InteractiveShellEmbed
n = 1
print('start embed')
embed()
# === ipython interactive shell ===
#
# print(n)
# => 1
#
# n += 1
#
# Ctrl + D : exit ipython
print('end embed')
ipshell = InteractiveShellEmbed()
print('start interactive shell')
ipshell()
# === ipython interactive shell ===
#
# print(n)
# => 2
#
# Ctrl + D : exit ipython
print('end interactive shell')
Es waren nützliche Informationen. Es ist kurz, aber das war's von hier.
http://ipython.org/ipython-doc/2/interactive/reference.html#embedding