3 ms·
Python has become my goto for anything more complicated than a 3 line bash script, but not so complex it need multiple files to logically separate the code. Arg
by tpmoney 3y ago
Python has become my goto for anything more complicated than a 3 line bash script, but not so complex it need multiple files to logically separate the code. Argparse isn't perfect, but it lets you get 90% of the way to a nice functional argument parsing system, with auto-generated help output that mostly doesn't suck. It's also built in so I can rely on it being anywhere python is already installed. And python is ubiquitous enough in default installs now I can pretty much rely on it being present as much as I can rely on bash being present.
As a result, every command line bit of glue code I've written for the last decade or so has been in python. At a certain point, it does start to get unwieldy and you can indeed write some awful code in it, but then again, I've seen some pretty awful bash scripts too.
My favorite trick is the fact that you can tell python to
- nomorecodehere8 3y agoIt's evolution. I like Python, it gets love and support. And it's all about the data structures - really. With python all I have to do is figure out the data - the rich set of OO, functional or imperative approaches and APIs does the rest.