Created
March 7, 2015 11:43
-
-
Save vectoroc/635e231167e60ecb1285 to your computer and use it in GitHub Desktop.
interactive python shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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