Skip to content

Instantly share code, notes, and snippets.

@vectoroc
Created March 7, 2015 11:43
Show Gist options
  • Save vectoroc/635e231167e60ecb1285 to your computer and use it in GitHub Desktop.
Save vectoroc/635e231167e60ecb1285 to your computer and use it in GitHub Desktop.
interactive python shell
def debug_shell(locals):
import code
import readline
import rlcompleter
# do something here
vars = globals()
vars.update(locals)
readline.set_completer(rlcompleter.Completer(vars).complete)
readline.parse_and_bind("tab: complete")
shell = code.InteractiveConsole(vars)
shell.interact()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment