Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Vincent Davis Newsgroups: comp.lang.python Subject: Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up Date: Mon, 1 Feb 2016 11:40:26 -0700 Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 9E3/y7SGi8b+nkZASwgt0AIfLzzkLczh1seznlohaCqw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'except:': 0.07; 'cc:addr :python-list': 0.09; 'dict': 0.09; 'url:github': 0.09; 'received:209.85.218': 0.10; 'jan': 0.11; 'subject: \n ': 0.15; '2016': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'try:': 0.18; 'email addr:gmail.com>': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'sat,': 0.23; 'header :In-Reply-To:1': 0.24; 'example': 0.26; 'message- id:@mail.gmail.com': 0.27; "can't": 0.32; 'subject:all': 0.32; 'wrap': 0.33; 'list': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'doing': 0.38; 'received:209': 0.38; 'stuff': 0.38; 'some': 0.40; 'here.': 0.62; '30,': 0.63; 'better.': 0.66; 'url:master': 0.84; 'do:': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vincentdavis.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VEnvEOYbGS9APqi1/8FdS1aSvBhTSRcvZ9MjRqgQKrc=; b=MV/+5IQtX4sKR6ayUhTmQbm62VTaTqYjtFE9xeCJaQVBr4+ZYlLaKxZUDpbzTvvOW2 Lgu0T5uvvcLjs0pSE/ZYaMu8VnDAT3Nz2nS1GjZziN5meOrnRbFGHoHNZK5uyQAuu/Bc qTnaHB8nHPoqFHb76WqgaY4I4NbXl/dav4tkA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=VEnvEOYbGS9APqi1/8FdS1aSvBhTSRcvZ9MjRqgQKrc=; b=RcUTyZg113RlCOL0IYs6/lztZsk0OFQrwBHN3Pi5/heR9p67S3dLldzhYQ8cnYaGq4 Jm9ikKkiMc0nTBr9RbtbeSK1LxonaaIJG/mfXcUP4a0hhJBazKys2S7O+dUPkZRSFYer KaSJJQYjxa7anKHWi5ydFT/dzMOcm22ak1If/SqYOiZZxCpAwvekpIXWg4EHXqpeS2hw 4IETyis3P9bbbDCM3pAn0JhOFSaik3CtXl7+vBsagtyhrU8eAMaQTw/O1Y3TtRffws9k UlBcXYtB1WXkuWm9i+G7UOz2EKJ80rPWr9xA3cr4ihwfsr5phd/drOshlWmG2rhMHw+s Th6Q== X-Gm-Message-State: AG10YOQWdmh2X1KoOnpCrulavbDo2GfVlfPLZdsUdNnuYklM3E2ZDmfyQOGWFyitDnvEzQdLLH0N87XagbpaaWPE X-Received: by 10.202.239.212 with SMTP id n203mr18782707oih.77.1454352046327; Mon, 01 Feb 2016 10:40:46 -0800 (PST) In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.20+ X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102390 On Sat, Jan 30, 2016 at 9:58 PM, Veek. M wrote: > Is there some other nice way to wrap this stuff up? > I can't do: > try: > x= > y= > z= > except: > I happend to Have just been doing the something similar. You can put x,y,x in a list and loop over it. In my case a dict was better. See the example here. https://github.com/vincentdavis/USAC_data/blob/master/tools.py#L24 Vincent Davis 720-301-3003