python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
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
import code; code.interact(local=dict(globals(), **locals())) |
@charterchap No. ^D continues execution, exit() terminates completely.
perfect! Its a standard in my work ;)
import ipdb; ipdb.set_trace()
danke!
Amazing! Thank you!
It was very helpful to me.
⭐ 👍
Very helpful, thank you 👍 !
still searching for this
jjajaja
i dont see how to use this...how do i view the data in my object? is it the same commands as pdb?
i dont see how to use this...how do i view the data in my object? is it the same commands as pdb?
@TimB0 The same way you would in an interactive Python shell :)
$ python3 -c 'x = 42; import code; code.interact(local=dict(globals(), **locals()))'
>>> x
42
(and when you're done, use ^D
(EOF) to continue or quit()
to abort the program)
def pry():
import inspect
frame = inspect.currentframe().f_back
try:
import code;
code.interact(local=dict(frame.f_globals, **frame.f_locals))
finally:
del frame
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/Mic92/pry.py