4 ms·
Python is a terrible choice for that sort of thing. Who really wants to have to set up a venv and deal with pip nonsense just to write a config file? Hell even
by IshKebab 2y ago
Python is a terrible choice for that sort of thing. Who really wants to have to set up a venv and deal with pip nonsense just to write a config file? Hell even installing Python is sometimes difficult.
- MathMonkeyMan 2y agoStick to the standard library as of an oldish version of python (3.6?) and it's pretty much zero-install zero-config.
- threeseed 2y agoOn a Mac, Python has always been a challenge. Up until recently Apple only included Python2 and so developers used Homebrew to install Python3. Now it’s very common to find two versions of Python3 installed on a Mac developer’s laptop that conflicts with each other. You really want to be using virtualenv.
- tom_ 2y agoHence the advice to stick to the standard library - because then it doesn't matter all that much. I'm not sure what the full set of environments I've tested my Python 3 scripts actually is, but they've run OK on all the various cloud CI systems I've tried, plus my laptops, VMs, and work PCs.
- iforgot22 2y agoAll a Mac user has needed to do was install from https://www.python.org/downloads/ https://www.python.org/downloads/ and then run python3 in the shell. Even if you use MacPorts or brew or conda or whatever, there's a distinct command to run Python 3 instead of 2. I get that Python's package manager situation is terrible, but like the other user said, you only need built-in packages to spit out a config json or whatever.
- threeseed 2y agoSo you would then you end up with three Python3 installations. And if you install from the website it doesn’t override the path. So will still be using the Apple or Homebrew one.
- iforgot22 2y agoIf you install it 3 times then yeah, but even then, all 3 of them will still work. But I could've sworn the python.org installer set the PATH. If not, that's kinda annoying.
- dkkergoog 2y ago[dead]
- iforgot22 2y agoIf only Python had the equivalent of npm.
- aiiizzz 2y agoThought that was pdm. Never saw it used so far.
- have-a-break 2y agoYou could say the same thing about setting up a JVM...
- fastasucan 2y agoYou don’t need any of that now that we have uv (https://github.com/astral-sh/uv https://github.com/astral-sh/uv)
- IshKebab 2y agoNot really. Uv is great but it doesn't really help here. If an app uses Python as its configuration file format then the app is running Python. It's going to do `python3 config.py` or similar. It doesn't know anything about uv. So you would still need to create a uv project, run `uv sync` and `uv activate` or whatever and then run your app. Not practical. The only option if you use Python as a config file format is to stick to old features (Python 3.6) and not use any third party libraries. But op was saying third party libraries are one of the benefits of using Python...