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: 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: References: <51b2d157-3fea-4f8e-80b4-e7142629eca8@s21g2000pre.googlegroups.com> Date: Wed, 3 Aug 2011 11:04:53 -0700 Subject: Re: Snippet: The leanest Popen wrapper From: Phlip To: Chris Rebert 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 > 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 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 shell=3D True, > I would strongly encourage you to avoid shell=3DTrue. 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! --=20 =A0 Phlip =A0 http://c2.com/cgi/wiki?ZeekLand