You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I define a shell to debug my code from IPython:
fromIPython.terminal.embedimportInteractiveShellEmbedipshell=InteractiveShellEmbed(config=cfg, banner1=banner_msg, exit_msg=exit_msg)
defipsh():
frame=inspect.currentframe().f_backmsg='Stopped at {0.f_code.co_filename} at line {0.f_lineno}'.format(frame)
ipshell(msg,stack_depth=2) # Go back one level!
I use it by leaving ipsh() anywhere in my code where I want to drop down into an IPython shell, i.e.
# code I want to debug/inspect# ....ipsh()
# code I want to debug/inspect# ....
Once I am in this embedded shell, if I do the following:
Thanks - I think this is the same as issue #136. There's more discussion there, but in short: it's a limitation of Python's execution model, but there may be a way we can work around it.
Say I define a shell to debug my code from IPython:
I use it by leaving
ipsh()
anywhere in my code where I want to drop down into an IPython shell, i.e.Once I am in this embedded shell, if I do the following:
I get the error:
NameError: global name
ciis not defined
. This error doesn't happen if I run the snippet above from a regular IPython shell.The above is with the latest stable version of IPython and Python (Python 2.7.x).
The text was updated successfully, but these errors were encountered: