Nice. Similar to PyP from Sony Imageworks:<p><a href="http://opensource.imageworks.com/?p=pyp" rel="nofollow">http://opensource.imageworks.com/?p=pyp</a><p>The Pyed Piper Tutorial: <a href="http://www.youtube.com/watch?v=eWtVWF0JSJA" rel="nofollow">http://www.youtube.com/watch?v=eWtVWF0JSJA</a>
You should put up a donation link. If more people do that and it becomes common practice to donate to useful open source tools / projects then imagine what more awesome stuff could be created. Many people desire to build tools but don't have the financial support to do so.
ls | py -x '"mv %s %s.txt" % (x,x)' | sh has me worried, I can't find the escape code directly. Also you might wish to offer the following api ls | py -X '["mv","%s","%s.txt"] and run those using processes or sub-process. This would ensure the right argument in the right place. Just an idea.
I like it! Now I can count the number of files I have in a directory:<p><pre><code> ls |py -l 'sum(1 for x in l)'</code></pre>
And also I can count the number of files whose names matche a certain extension:<p><pre><code> ls |grep .py |py -l 'sum(1 for x in l)'
</code></pre>
I am not saying it was not possible before, but I don't know how to do it in bash.<p>Looking forward to use that for some basic stats on file. The following should sum up the first column of a csv.<p><pre><code> cat data.csv| py -x 'x[0]' |py -l 'sum(x for x in l)'</code></pre>
A simpler version of py is e ⌘ <a href="https://pypi.python.org/pypi/e/1.4.5" rel="nofollow">https://pypi.python.org/pypi/e/1.4.5</a>
I attempted to install on Windows - it doesn't work due to the lack of os.geteuid(), which is called in the setup.py file to check for root. With a little bit of finagling I could get around that and make it install, but not work due to undefined SIGPIPE in the signal module. It makes sense that this could be UNIX only, but that wasn't stated anywhere on the webpage. Perhaps that should be mentioned somewhere.
I usually use Python(or another lang's interpreter) as my calculator, so this will save me a few keystrokes in the future. I think I'll still use short scripts rather than the command line to do more involved things (like find long palindromes in a txt file), but this will save me a bit of time when doing quick calculations. Thanks!
Would've been more useful with a language that doesn't limit one-liners (e.g. you can't have "for x in [1,2,3]: dothing1(x); dothing2(x)").