Language Selection

English French German Italian Portuguese Spanish

With iterpipes, python is ready to replace bash for scripting. Really.

Filed under
Software

This has been a pet peeve of mine for years: programming shell scripts suck. They are ugly and error prone. The only reason why we still do it? There is no real replacement.

Or at least that was the case, until today I met iterpipes at python.reddit.com

Iterpipes is "A library for running shell pipelines using shell-like syntax" and guess what? It's brilliant.

Here's an example from its PYPI page:

# Total lines in *.py files under /path/to/dir,
# use safe shell parameters formatting:

>>> total = cmd(
... 'find {} -name {} -print0 | xargs -0 wc -l | tail -1 | awk {}',
... '/path/to/dir', '\*.py', '{print $1}')
>>> run(total | strip() | join | int)
315

Here's how that would look in shell:




More in Tux Machines

today's howtos

Leftovers: Gaming

Fedora 21 Alpha to release on Tuesday

Today the Fedora Engineering Steering Commitee held a “Go/No Go” meeting regarding the Fedora 21 alpha, and it was agreed that the current release candidates for Fedora 21 met the release criteria. With this decision, this means that Fedora 21 will be released on Tuesday September 23, 2014. Read more

Teaching open source changed my life

Teaching open source has been a breath of fresh air for myself and for many of our students because with the open source way, there are no official tests. There is no official certification for the majority of open source projects. And, there are no prescribed textbooks. In open source, no employer worth working for will ask for official proof of your abilities. A good employer will look at what you’ve done and ask you to showcase what you can do. Yes, it still helps to have a Computer Science degree, but the lack of one is often no drawback. Read more