首页 > Linux操作系统 > Linux操作系统 > Plumbum - Python Shell Combinators

Plumbum - Python Shell Combinators

原创 Linux操作系统 作者:jieforest 时间:2012-05-28 12:59:33 0 删除 编辑
[i=s] 本帖最后由 jieforest 于 2012-5-16 10:52 编辑

Ever wished the wrist-handiness of shellscripts be put into a real programming language? Say helloto Plumbum Shell Combinators. Plumbum (Latin for lead,which was used to create pipes back in the day) is a small yet feature-richlibrary for shell script-like programs in Python. The motto of the libraryis "Never write shell scripts again", and thus itattempts to mimic the shell syntax ("shellcombinators") where it makes sense, while keeping it all pythonicand cross-platform.

Apart from shell-like syntax and handyshortcuts, the library provides local and remote command execution (over SSH),local and remote file-system paths, easy working-directory and environmentmanipulation, and a programmatic Command-Line Interface (CLI) applicationtoolkit. Now let's see some code!

This is only a teaser; the fulldocumentation can be found at Read the Docs



>>> from plumbum import local, FG, BG
>>> from plumbum.cmd import ls, grep, wc, cat, head
>>> ls
>>> ls()

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

下一篇: Spring Roo 1.2.2发布
请登录后发表评论 登录


  • 博文量
  • 访问量