Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.032 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'pil': 0.09; 'try:': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'filelist': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ioerror:': 0.16; 'should.': 0.16; 'subject:those': 0.16; 'wrote:': 0.18; 'example': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'somewhere': 0.26; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'lines': 0.31; 'indentation': 0.31; 'figure': 0.32; 'front': 0.32; 'up.': 0.33; 'except': 0.35; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'should': 0.36; 'list': 0.37; 'nov': 0.38; 'files': 0.38; 'issue': 0.38; 'skip:o 30': 0.61; "you're": 0.61; 'further': 0.61; 'first': 0.61; "you'll": 0.62; 'become': 0.64; 'here': 0.66; 'between': 0.67; 'messed': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=oQpU/5IifFzvhtH2px5BbyNPm0WNr39Yh1I+if8DidI=; b=iaz3fHGtRo2h/X2LTY86Viv+7Y+xud/83gcCRUQtOnCI44UsDLXz8/JoMSorZGM/Gf 1Y3PnF9pJADNsEpEQs6qbEtRyz0oAzw6MQAGzXylClJcavgDjYvcew1q1ZfHEdCQitvX uzE9X3K2ShV2chdNZCKTMfRtzMeSDxlV6xndy0lImHWcQzSiY04zHDCxPcA1oyJhkPTk NMqobwnWNN+hCBNuvMu9Pj0UYyr9U7plflgai3cTNr7LaKqi8O+L5GkNxyayIphMhQvv LqQ/ivAPSm4S2Mp8ZJT+ZbhmiOwajy+7bp9Wjs5lRDSmrxpj6UBFB9KKr6Hk6M2jS5Ia YPHA== MIME-Version: 1.0 X-Received: by 10.42.216.77 with SMTP id hh13mr24805698icb.31.1416175272839; Sun, 16 Nov 2014 14:01:12 -0800 (PST) In-Reply-To: References: Date: Mon, 17 Nov 2014 09:01:12 +1100 Subject: Re: How to fix those errors? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416175276 news.xs4all.nl 2921 [2001:888:2000:d::a6]:33902 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80917 On Mon, Nov 17, 2014 at 8:32 AM, Abdul Abdul wrote: > from PIL import Image > import os > > for inputfile in filelist > outputfile = os.path.splitext(inputfile)[0]+".jpg" > if inputfile != outputfile: > try: > Image.open(inputfile).save(outputfile) > except IOError: > print "unable to convert ", inputfile The first issue I'm seeing here is that your indentation is messed up. I've no idea where your example is coming from, but somewhere between working code and what I'm seeing in front of me, some lines have become indented further than they should. You'll also need to figure out what the list of files should be. That's why you're seeing errors about 'filelist'. ChrisA