Best way to go about running a file in Python? Need advice!

22 Replies, 2086 Views

Hey y'all,
So I’ve been messing around with running a file in Python, and honestly, I’m kinda stuck on the *best* way to do it. Like, do I just use `python script.py` in the terminal and call it a day? Or is there some fancy IDE trick I’m missing out on?

I’ve seen people use `exec()` or `subprocess`, but that feels like overkill for my lil’ project. Also, what’s the deal with relative paths? Sometimes it works, sometimes it doesn’t, and I’m like ???

Anyway, what’s your go-to method for running a file in Python? Keep it simple, pls. I don’t wanna overcomplicate things, but I also don’t wanna miss out on something obvious.

Thx in advance! 🙏

Messages In This Thread
Best way to go about running a file in Python? Need advice! - by - 08-09-2024, 06:44 AM



Users browsing this thread: 1 Guest(s)