This line triggered me.
Show HN: Sultan – Pythonic interface to your shell
31–40 of 54 posts
Re: Show HN: Sultan – Pythonic interface to your shell
#32Very nice! I've been using somewhat similar sh [1] for the same purpose. It's nice seeing more alternatives. [1] https://amoffat.github.io/sh/
Invoke: http://www.pyinvoke.org/ wraps subprocess commands into Makefile-like tasks
Fabric: http://www.fabfile.org/ Same as invoke, but catered to remote subprocess commands over SSH
Re: Show HN: Sultan – Pythonic interface to your shell
#33Very nice! I've been using somewhat similar sh [1] for the same purpose. It's nice seeing more alternatives. [1] https://amoffat.github.io/sh/
Two more resources on top of sh: Invoke: http://www.pyinvoke.org/ wraps subprocess commands into Makefile-like tasks Fabric: http://www.fabfile.org/ Same as invoke, but catered to remote subprocess commands over SSH
Re: Show HN: Sultan – Pythonic interface to your shell
#34This seems to be a simple wrapper around subprocess, but I'm afraid it is not changing things dramatically. Overall, I don't agree that Sultan's syntax is any more Pythonic than subprocess itself. +1 for https://sultan.readthedocs.io/en/latest/sultan-examples.html... I think it would be interesting if you could iterate on the results of "ls -l", where each row is represented by an object.
And then I remember that Windows PowerShell does (attempts to, to be fair) exactly that
Output of ls in PS is an Array of objects (DirectoryInfo or FileInfo instances). How is that merely an attempt?
Re: Show HN: Sultan – Pythonic interface to your shell
#35Re: Show HN: Sultan – Pythonic interface to your shell
#36Earlier quoted context omitted.
Cool subprocess is a little verbose. But did you happen to notice if it executes with shell=True or shell=False?
Do you include Python 3.5's subprocess.run in that assessment? I find it much cleaner for the common cases than the rest of the API: https://docs.python.org/3/library/subprocess.html#using-the-...
Re: Show HN: Sultan – Pythonic interface to your shell
#37Re: Show HN: Sultan – Pythonic interface to your shell
#38No example even if you click on FAQ … what is sultan.
Re: Show HN: Sultan – Pythonic interface to your shell
#39I wrote a pretty significant process wrapper in python at $PREVIOUS_JOB. The problem I have with these loose wrappers around subprocess is that they're, imho, solving the wrong problem. Or, maybe better put, not solving _enough_ of the problem. Imagine writing a wrapper for "grep". It may work in one environment, but if you need portability, you're going to quickly realize that there are nuances in implementation and…
does that make subprocess module like urllib, and these wrappers like the ubiquitous requests package?
I think it's harder than you say: a given tool like grep has an API the size of an entire website, and then depending on usage, has different usage patterns which different optimizations.
Also, a REST API user is consuming an API, whereas a CLI wrapper is consuming an API to implement another. Much bigger fish to fry there, I think.