Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #10820
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <phlip2005@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.038 |
| X-Spam-Evidence | '*H*': 0.93; '*S*': 0.00; 'else:': 0.03; 'python': 0.08; 'recipe': 0.09; 'defined': 0.14; 'cookbook': 0.16; 'found"': 0.16; 'reconcile': 0.16; 'thru': 0.16; 'cc:addr:python-list': 0.16; 'def': 0.16; 'true,': 0.19; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'url:wiki': 0.25; 'yourself.': 0.28; 'message-id:@mail.gmail.com': 0.28; 'shell': 0.29; 'yield': 0.29; 'cc:addr:python.org': 0.30; 'it.': 0.33; 'copied': 0.35; 'running': 0.35; 'doing': 0.37; 'getting': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'received:209': 0.40; 'url:cgi': 0.64; 'subject:The': 0.73; 'long-term': 0.80; 'escaping': 0.84; 'sequence:': 0.84; 'shelly': 0.84; 'received:209.85.218.46': 0.91; 'received:mail- yi0-f46.google.com': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=40NvtAw7iE5prRiBA0La4BovEUIyc52dUIyewB3ZKhU=; b=omclXMUhXSA1tUZ9Stqvw7RDycPpVC+8NrTx9xfh6dfTWkrCBdtmnRT6bSGQgVWTAE RbgbYD9uxX2m/x9nid4Ygrm78clekMxtYqk4skfIdiO9toDTgYsMewhm/yZVb/Yr94f8 K0DhCYV3UR7GoLeE4xGdmvpDyYraa/Qn8h+fI= |
| MIME-Version | 1.0 |
| In-Reply-To | <CAMZYqRTZ9hJcf+TpHoKMcNCq6i1_HpAnkK9OBU21g-g6_bKCug@mail.gmail.com> |
| References | <51b2d157-3fea-4f8e-80b4-e7142629eca8@s21g2000pre.googlegroups.com> <CAMZYqRTZ9hJcf+TpHoKMcNCq6i1_HpAnkK9OBU21g-g6_bKCug@mail.gmail.com> |
| Date | Wed, 3 Aug 2011 11:04:53 -0700 |
| Subject | Re: Snippet: The leanest Popen wrapper |
| From | Phlip <phlip2005@gmail.com> |
| To | Chris Rebert <clp2@rebertia.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1858.1312394695.1164.python-list@python.org> (permalink) |
| Lines | 28 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1312394695 news.xs4all.nl 23844 [2001:888:2000:d::a6]:52557 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:10820 |
Show key headers only | View raw
> flatten() being defined as...?
Python Cookbook recipe 4.6
def flatten(sequence): # CONSIDER: Reconcile with utils...
for item in sequence:
if isinstance(item, (list, tuple)):
for subitem in flatten(list(item)):
yield subitem
else:
yield item
>> shell= True,
> I would strongly encourage you to avoid shell=True. You really don't
> want to have to worry about doing proper shell escaping yourself.
Tx for helping me avoid reading up on it. I just copied it in.
I keep getting "fab not found" etc. when running 'fab command' thru
it. So then I ditch to os.system().
The long-term solution would be 'bash', '-c', 'yack yack yack' if you
want truly shelly things!
--
Phlip
http://c2.com/cgi/wiki?ZeekLand
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Snippet: The leanest Popen wrapper Phlip <phlip2005@gmail.com> - 2011-08-03 08:29 -0700
Re: Snippet: The leanest Popen wrapper Peter Otten <__peter__@web.de> - 2011-08-03 18:21 +0200
Re: Snippet: The leanest Popen wrapper Thomas Jollans <t@jollybox.de> - 2011-08-03 18:39 +0200
Re: Snippet: The leanest Popen wrapper Chris Rebert <clp2@rebertia.com> - 2011-08-03 10:27 -0700
Re: Snippet: The leanest Popen wrapper Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-08-04 10:10 +0200
Re: Snippet: The leanest Popen wrapper Chris Rebert <clp2@rebertia.com> - 2011-08-04 01:42 -0700
Re: Snippet: The leanest Popen wrapper Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-08-04 11:25 +0200
Re: Snippet: The leanest Popen wrapper Phlip <phlip2005@gmail.com> - 2011-08-03 11:04 -0700
Re: Snippet: The leanest Popen wrapper Terry Reedy <tjreedy@udel.edu> - 2011-08-03 16:20 -0400
Re: Snippet: The leanest Popen wrapper Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-08-04 10:24 +0200
Re: Snippet: The leanest Popen wrapper Yves-Gwenael Bourhis <ybourhis@distroiwork4.com> - 2011-08-04 15:19 +0200
csiph-web