Live data from Hacker News

Show HN: Sultan – Pythonic interface to your shell

sultan.readthedocs.io

51–54 of 54 posts

Re: Show HN: Sultan – Pythonic interface to your shell

#51
Here's a comment I made some time ago on HN about similar / related Python libs / tools:

https://news.ycombinator.com/item?id=8735892#8737512

Edit: That comment was part of an HN thead about this topic, which might be interesting in its own right:

Streem – a new programming language from Matz (github.com)

https://news.ycombinator.com/item?id=8735892

Re: Show HN: Sultan – Pythonic interface to your shell

#52
post #26

Earlier quoted context omitted.

OK. I thought this would be so obvious that people would see it. Sultan says "Sultan was created to help with scripts that we create with Bash, that tend to get complex." If one has an open mind, one should be asking "why would I use bash for this at all, when there exists a far superior command shell, xonsh, which incorporates all of bash's capability, with all of python, in one piece?" Why are we trying to interfac…

You don't need to interface with bash necessarily you need to interface with binaries on the system like apt for example

Which is exactly what xonsh does.

Re: Show HN: Sultan – Pythonic interface to your shell

#53

Earlier 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-...

I hadn't actually noticed that! It looks like .run() allows input and output to be piped and the return code captured. That is a serious improvement over subprocess.call().

Re: Show HN: Sultan – Pythonic interface to your shell

#54

Earlier quoted context omitted.

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-...

Doesn't seem that different from call()

It looks like it allows stdin, stdout, stderr and return code to be handled properly which call() doesn't. It's still syntactic sugar over Popen() and communicate() but will cut down boilerplate for calling external processes.
Post reply on HN