Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active July 29, 2022 14:47
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Integralist/a2f01ab4aabb786268d5006da5013c9e to your computer and use it in GitHub Desktop.
Save Integralist/a2f01ab4aabb786268d5006da5013c9e to your computer and use it in GitHub Desktop.

Basic

import code; code.interact(local=locals())

Advanced

IPython with embed()

Install it with:

pip install ipython

Use it like so:

from IPython import embed

# Misc code

embed() # this will drop us into IPython

# Misc code

Although you can use it directly as well:

import IPython

x = "foo"
print(x)

IPython.embed()

x = "bar"
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment