This is a demo for Subrun.
Subrun is an intuitive API to safely start and communicate with processes in Python.
To play with this demo, copy-paste the Python code below and then run it after installing Subrun.
To install Subrun:
$ pip install subrun
A pipeline of three commands is run. The output is the Zen of Python sorted alphabetically. The title and the next line are removed before the sort operation.
You can run the same pipeline in your shell:
$ python -m this | tail --lines=+3 | sort
Although never is often better than *right* now.
Although practicality beats purity.
Although that way may not be obvious at first unless you're Dutch.
Beautiful is better than ugly.
Complex is better than complicated.
Errors should never pass silently.
Explicit is better than implicit.
Flat is better than nested.
If the implementation is easy to explain, it may be a good idea.
If the implementation is hard to explain, it's a bad idea.
In the face of ambiguity, refuse the temptation to guess.
Namespaces are one honking great idea -- let's do more of those!
Now is better than never.
Readability counts.
Simple is better than complex.
Sparse is better than dense.
Special cases aren't special enough to break the rules.
There should be one-- and preferably only one --obvious way to do it.
Unless explicitly silenced.
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!