Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Announce

Introducing Plumbum: Shell Combinators

 

 

Python announce RSS feed   Index | Next | Previous | View Threaded


tomerfiliba at gmail

May 11, 2012, 9:00 AM

Post #1 of 1 (93 views)
Permalink
Introducing Plumbum: Shell Combinators

Write shell-like scripts in pure python (and never resort to writing bash scripts again!)

Plumbum provides local and remote process execution, path abstraction, lots of shell-like utilities and a command-line interface (CLI) application toolkit that beats optparse/argparse to the ground. Give it a try.

http://plumbum.readthedocs.org/

>>> from plumbum.cmd import ls, grep, wc, cat, head
>>> ls()
u'build.py\ndist\ndocs\nLICENSE\nplumbum\nREADME.rst\nsetup.py\ntests\ntodo.txt\n'
>>> (ls["-a"] | grep["-v", "\\.py"] | wc["-l"])
u'13\n'
>>> ((cat["setup.py"] | head["-n", 4]) > "output.txt")()
u''
>>> cat("output.txt")
u'#!/usr/bin/env python\nimport os\n\ntry:\n'
--
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/

Python announce RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.