Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python is available virtually anywhere. I'd also not use Bash unless it's a very restricted situation. Every time I'm writing a shell script that's more than a page, a sense of imminent doom starts to dominate my soul.


“Python” isn’t very well-defined. Which version? Which (installed) dependencies?


No it isn't. I don't know what kind of infrastructure you work on but I can't just go installing python on prod servers whenever I want to be able to run some random script.


I think that people that work on RHEL often assume python just "exists" everywhere because DNF has a python dependency, same for Debian, apt and perl.


In Kubernetes, you can attach a debug container with Python to a running pod.

On VM's you can use pyenv for a local Python installation if you don't want to install it globally.

In Docker vanilla, you can run another container with Python that uses the same namespaces (ipc, pid, network) as your other running container without Python.

There are options. If your security team forbids Python for some reason, I would wonder why they are letting systems have bash/curl/etc on them.


Why are you running random scripts on prod servers? ;) :P


Sometimes the only way to investigate a problem. How can you even write a test case if you don't know what's going on?


Python subprocess is terrible. Until they provide a much smoother interface for running other programs, bash will continue to dominate scripting.


Python is not available by default on macOS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: