How can I run a script inside the Python shell effectively?

20 Replies, 1473 Views

I’ve been using `exec()` for years and it’s fine as long as you’re careful. Just make sure you’re not running untrusted code.

For debugging, I’d say start with `try/except` blocks to catch errors.

Also, if you’re running scripts inside Python shell often, maybe look into using `ipdb`—it’s like `pdb` but with IPython features.

Messages In This Thread



Users browsing this thread: 1 Guest(s)