TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Plumbum: Pythonic Shell Combinators

76 pointsby mnazimabout 13 years ago

10 comments

friggeriabout 13 years ago
Someone needs to explain to me in what parallel universe<p><pre><code> (sudo[ifconfig["-a"]] | grep["-i", "loop"]) &#38; FG </code></pre> is more readable than<p><pre><code> sudo ifconfig -a | grep -i loop &#38;</code></pre>
评论 #3965560 未加载
评论 #3965577 未加载
评论 #3966363 未加载
tveitaabout 13 years ago
I'm sure it's convenient, but I wouldn't call this kind of operator overloading "pythonic".<p>Not to say being pythonic is always better, but some of these tricks don't even seem that practical. Why "&#38; FG" instead of .fg()? Using division for joining paths is cute, but why not use '+', the conventional append operator?
评论 #3966367 未加载
jal278about 13 years ago
This reminds me of when I first saw drop-box: Immediate recognition of the pain it will save me. I often hack up kludges that approximate this -- os.system calls that pipe to a file, then I read and parse the file. Good work.
评论 #3965926 未加载
colinmarcabout 13 years ago
Some really clever tricks here. I particularly like the __getitem__ one. I'm simultaneously excited and filled with horror. =)
gbogabout 13 years ago
I think this attempt and other simile are fun but I doubt I would use them for serious things. Maybe it should be done the other way: like markdown is an extension of html, we could have an extension of shell with python syntax.
cingabout 13 years ago
While we're on the topic, here's another shell scripting package for Python: <a href="https://github.com/amoffat/pbs" rel="nofollow">https://github.com/amoffat/pbs</a>
评论 #3966400 未加载
jhalesabout 13 years ago
I'm not quite sure I understand the value added over "!ls" etc on iPython. Is this module primarily for use on the vanilla interpreter?
mariocesarabout 13 years ago
The coolest thing I see this year!
ehoscaabout 13 years ago
thats Lead ....
cheatercheaterabout 13 years ago
Haskell has done it long ago and much better:<p><a href="http://news.ycombinator.com/item?id=3966630" rel="nofollow">http://news.ycombinator.com/item?id=3966630</a>