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! 🙏
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! 🙏
