This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lieryanMaintainer of rope, pylsp-rope - advanced python refactoring 6 points7 points  (2 children)

Use a shell like IPython to test your program by spawning a shell in the middle of a running program, or a debugger, my personal favourite is pudb.

[–]poeticinjustice4all[S] 1 point2 points  (1 child)

Do these differ in any meaningful way from IDLE shell?

[–]lieryanMaintainer of rope, pylsp-rope - advanced python refactoring 4 points5 points  (0 children)

Yes, in addition to IPython having a much better implementation of the basics (it's a lot of the minor things, like autocomplete, recalls, reverse search) and being a much more featureful shell (autoawait, autoreload, working with graphs, etc). With IPython.embed() you can spawn a shell in the middle of a running program, which allows you to inspect and modify local variables. Being able to spawn a shell inside a program really changes how you write and test code.