|
|
|
|
|
by blabitty
1905 days ago
|
|
I wonder too. Things like file and directory manipulations are way more complicated in native Python and I find the exceptions harder to troubleshoot than native commands. I'm not even going to get into pythons version and dependency hell, suffice it to say I have more confidence in a standard version of bash and standard utilities generally being present on a modern Linux system.
What I've seen from pythonistas as reasoning for this replacememt love is usually one or a combination of a few things - a claimed write once run anywhere ability that I think is generally fantasy, a belief that Python is a "real" language and shell is not which usually just means "I don't like shell or think it is unfashionable", or a belief that Python code can be made more reusable. The person in question almost always has a background of feature developer that is now doing devops type tasks. All that said I like python and there are tasks I absolutely prefer it for, usually anything to do with scraping some web API that returns a complex piece of JSON or xml. |
|
I am allowed to call 'mv' or 'cp' binaries from bash.
I am also allowed to call 'mv' or 'cp' binaries from python with subprocess!
(Edit: bad example binaries, 'df' or 'tar' would be probably better.)
I must choose not to install bash libraries for a bash script beyond builtins.
I can choose not to install python libraries beyond builtins.
It becomes a really simple tradeoff.
Nobody forces you to step out of python's stdlib. No extra dependencies. And you can still reap benefits of a proper programming language.