How to Run a Python File in Jupyter Terminal: What's the Best Way to Do It?

14 Replies, 982 Views

Running a python file in Jupyter terminal is one of those things that’s just… meh. I usually just use `!python filename.py` in a cell. It’s not elegant, but it works.

If you’re having issues with paths, try using `os.chdir()` in a cell before running the script. That’s saved me a ton of headaches.

Also, if you’re open to trying something new, check out VS Code with the Jupyter extension. It’s way more flexible for running scripts and notebooks together.

Messages In This Thread



Users browsing this thread: 1 Guest(s)