Created
November 3, 2014 15:27
-
-
Save andrelaszlo/b6b0f1dfbff344fcbe66 to your computer and use it in GitHub Desktop.
Start interactive shell inside pythons cript
This file contains hidden or 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 drop_shell(global_vars, local_vars): | |
""" Call with drop_shell(global_vars().copy(), locals()) """ | |
import readline # optional, will allow Up/Down/History in the console | |
import code | |
global_vars.update(local_vars) | |
shell = code.InteractiveConsole(global_vars) | |
shell.interact() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment