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

20 Replies, 1474 Views

Hey! I usually just save my script and then do `python -i script.py` in the terminal. It runs the script and drops you into the shell with all the variables still there. Super handy for testing.

For debugging, I’d recommend using `pytest` if your script is more complex. It’s got great error reporting.

Also, if you’re into tools, check out Spyder. It’s an IDE designed for scientific computing, but it’s great for running and debugging scripts too.

Messages In This Thread



Users browsing this thread: 1 Guest(s)