• jjjalljs@ttrpg.network
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    I don’t know how to use vscode. In general in Python you can do breakpoint() and your code will pause there and become interactive. If you’re running in docker you’ll want to attach to the container. When it hits the breakpoint you basically drop into a normal python repl with extra features.

    https://docs.python.org/3/library/pdb.html

    This is really, really, good for debugging and developing. You can interactively examine stuff and try stuff right there. You don’t have to rerun the whole thing to be like “ok what’s the second item in the list? Is this syntax right to sort it?” or whatever you’re trying to do

    I use pdb++ for syntax highlighting and some other qol features, too.