Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #72295
| X-Received | by 10.236.117.11 with SMTP id i11mr5444076yhh.0.1401454046787; Fri, 30 May 2014 05:47:26 -0700 (PDT) |
|---|---|
| X-Received | by 10.50.78.195 with SMTP id d3mr98591igx.17.1401454046641; Fri, 30 May 2014 05:47:26 -0700 (PDT) |
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!c1no20780807igq.0!news-out.google.com!qf4ni17772igc.0!nntp.google.com!c1no20780805igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Fri, 30 May 2014 05:47:25 -0700 (PDT) |
| In-Reply-To | <mailman.10478.1401434433.18130.python-list@python.org> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=59.95.43.154; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui |
| NNTP-Posting-Host | 59.95.43.154 |
| References | <mailman.10468.1401411146.18130.python-list@python.org> <25135194-b9cb-4942-bead-c1bdf72923ee@googlegroups.com> <mailman.10478.1401434433.18130.python-list@python.org> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <a5dd8a43-58e2-4fb7-b2c2-c62601bce3d5@googlegroups.com> (permalink) |
| Subject | Re: Multi-line commands with 'python -c' |
| From | Rustom Mody <rustompmody@gmail.com> |
| Injection-Date | Fri, 30 May 2014 12:47:26 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Received-Bytes | 1882 |
| X-Received-Body-CRC | 3779711402 |
| Xref | csiph.com comp.lang.python:72295 |
Show key headers only | View raw
On Friday, May 30, 2014 12:50:31 PM UTC+5:30, Chris Angelico wrote:
> On Fri, May 30, 2014 at 4:04 PM, Rustom Mody wrote:
> > I thought when one signs up for python one has to sign an affidavit
> > saying:
> > "I shall not write one-liners\n" * 100
> Certainly not. I write all my list comps on one line!
> *ducking for cover*
Heres a more vile misuse of python3's print-as-function + list-comp-as-for:
python3 -c 'from os import walk; [print(r) for r, d, f in walk(".") if len(d+f) == 1]'
Well if C programmers can use ',' as one-line ';' and '?:' as one-line if
why not python also?
[To noobs who are reading: Dont do this!]
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Multi-line commands with 'python -c' Chris Angelico <rosuav@gmail.com> - 2014-05-30 10:52 +1000
Re: Multi-line commands with 'python -c' Rustom Mody <rustompmody@gmail.com> - 2014-05-29 23:04 -0700
Re: Multi-line commands with 'python -c' Rustom Mody <rustompmody@gmail.com> - 2014-05-29 23:45 -0700
Re: Multi-line commands with 'python -c' Rustom Mody <rustompmody@gmail.com> - 2014-05-29 23:54 -0700
Re: Multi-line commands with 'python -c' Peter Otten <__peter__@web.de> - 2014-05-30 09:33 +0200
Re: Multi-line commands with 'python -c' Terry Reedy <tjreedy@udel.edu> - 2014-05-30 11:29 -0400
Re: Multi-line commands with 'python -c' Chris Angelico <rosuav@gmail.com> - 2014-05-30 17:20 +1000
Re: Multi-line commands with 'python -c' Rustom Mody <rustompmody@gmail.com> - 2014-05-30 05:47 -0700
Re: Multi-line commands with 'python -c' Chris Angelico <rosuav@gmail.com> - 2014-05-30 22:58 +1000
Re: Multi-line commands with 'python -c' Duncan Booth <duncan.booth@invalid.invalid> - 2014-05-30 21:11 +0000
Re: Multi-line commands with 'python -c' Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-05-30 14:42 -0700
Re: Multi-line commands with 'python -c' Chris Angelico <rosuav@gmail.com> - 2014-05-31 07:47 +1000
Re: Multi-line commands with 'python -c' Duncan Booth <duncan.booth@invalid.invalid> - 2014-05-31 16:41 +0000
Re: Multi-line commands with 'python -c' Peter Otten <__peter__@web.de> - 2014-05-31 19:11 +0200
Re: Multi-line commands with 'python -c' Duncan Booth <duncan.booth@invalid.invalid> - 2014-06-01 20:43 +0000
csiph-web