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

Leftovers: Software

today's howtos

Leftovers: Gaming

Mozilla Firefox 32 Officially Released

It's been a little over a month since the previous Firefox stable release and the developers have now pushed a new major update to users. This latest iteration of Firefox brings just a few major features for regular users, but it excels in other areas like better HTML 5 support. The official announcement for Mozilla Firefox 32 hasn't been made public just yet, but the mirrors now host the latest stable versions. It will take them a while to post anything official, and some time may go by until this new release hits the repositories, but you now can get to see what has changed. Read more