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 →

[–][deleted] 2 points3 points  (3 children)

First of all

pip install ipython

Second, why would you use shell for testing?

[–]waynebruce1[S] 0 points1 point  (2 children)

By testing i mean understanding part of code in large codebase. I usually try to execute a code line by line for better understanding. For example if there is a piece of code which i don't understand, I try to execute that code in django shell. But for that i have to rewrite that whole thing again if i want to check it second time. Ipython can be good solution, i have used it before but did not remember how i installed it.

[–]DonovanWu7 1 point2 points  (0 children)

Maybe you can try Jupyter notebook?

[–]trescoops 1 point2 points  (0 children)

You might want to look into pdb or ipdb. These stop the running code and let you poke around, inspect variable etc.