Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 06 Sep 2011 02:09:37 -0500 Newsgroups: comp.lang.python Subject: Re: One line command line filter References: <4725b2c3-d930-4fb0-9fe7-a286d150f9c5@d18g2000yqm.googlegroups.com> From: John Wiegley Date: Tue, 06 Sep 2011 01:51:17 -0500 Message-ID: User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (darwin) Cancel-Lock: sha1:iHoxNhyIbF2GGk2F9UZ0/k5dQFM= MIME-Version: 1.0 Content-Type: text/plain Lines: 14 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-xWd2eNmGj1IG7yH9nDjqZ8aWT8c41PONatD+wOD3Z2n0WussDvdBJwX8RBQIq1C5bLGNeIUBNN45WX7!qYeowvYDZkHdiOFjEf8OY3Cj7OIWeqiN1egIYXmNjY0BAVh9 X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1374 Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12815 >>>>> Jon Redgrave writes: > It seems unreasonably hard to write simple one-line unix command line > filters in python: > eg: ls | python -c " print x.upper()" [...] > Is there a better solution - if not is this worth a PEP? Have you looked at PyP (http://code.google.com/p/pyp)? John