Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.057 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'pil': 0.09; 'try:': 0.09; 'subject:How': 0.10; 'errors:': 0.16; 'filelist': 0.16; 'ioerror:': 0.16; 'subject:those': 0.16; 'thanks.': 0.20; 'seems': 0.21; 'example': 0.22; 'import': 0.22; 'print': 0.22; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'getting': 0.31; 'except': 0.35; 'convert': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'expected': 0.38; 'follows:': 0.38; 'to:addr:python-list': 0.38; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:\xc2 10': 0.60; 'solve': 0.60; 'skip:o 30': 0.61; '8bit%:100': 0.72; '--->': 0.84; 'walking': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/3MIi8T38YU5j0hwTWfW9sPRFGLPOiVoHHKSuEpxePo=; b=WoXpP43VXESedTRN1AToXzzaO2n481fV7ilEn5R0GjHEEYfXYTITTFFo8EOT+rLEnc +R1sJD8PYfJauwoWU3f75iNJOKWCIQqsUP3D+VGFTnGtCbtD6OPAnO3QxswhZMMlBhG3 gOL4gmDUb/PNNhdwMOGa2ZhVb/cGiTf2xBW7pvwguvu3bsZbMvSDFuoLBIagXzZR3HOb r1JjcRvMnOtdRJAZDpGJe71QtYCLJVP3CLLZpMuQEHQJfn7rtuUMqX+5YnuYynL55ykv xOA9lWRi6r+phUyZnLFru6Ag/cJUv4VqA0cL7iCGdyhqGBfANlsRMJd4IK/GOSBfk/DS 5qtQ== MIME-Version: 1.0 X-Received: by 10.182.241.195 with SMTP id wk3mr20712254obc.33.1416173546937; Sun, 16 Nov 2014 13:32:26 -0800 (PST) Date: Sun, 16 Nov 2014 22:32:26 +0100 Subject: How to fix those errors? From: Abdul Abdul To: python-list@python.org Content-Type: multipart/alternative; boundary=089e01634b7e34a1c005080099ce X-Mailman-Approved-At: Sun, 16 Nov 2014 22:34:50 +0100 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: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416173691 news.xs4all.nl 2927 [2001:888:2000:d::a6]:37582 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80906 --089e01634b7e34a1c005080099ce Content-Type: text/plain; charset=UTF-8 Hello, I'm walking through an example that goes as follows: 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 I'm writing that in "Pycharm", and getting the following errors: * filelist ---> Unresolved reference 'filelist' * IOError: Statement seems to have no effect * The last 'filelist' ---> 'except' or 'finally' expected How can I solve those errors? Thanks. --089e01634b7e34a1c005080099ce Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello,

I'm walking through an example that goes= as follows:

from PIL import Image
import os
=C2=A0=C2=A0=C2= =A0
=C2=A0=C2=A0=C2=A0 for inputfile in filelist
=C2=A0=C2=A0=C2=A0 = outputfile =3D os.path.splitext(inputfile)[0]+".jpg"
=C2=A0=C2= =A0=C2=A0 if inputfile !=3D outputfile:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 try:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 Image.open(inputfile).save(outputfile)
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 except IOError:
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print "un= able to convert ", inputfile

I'm writing that in "Pych= arm", and getting the following errors:

* filelist ---> Unre= solved reference 'filelist'

* IOError: Statement seems to ha= ve no effect

* The last 'filelist' ---> 'except' = or 'finally' expected

How can I solve those errors?

T= hanks.

--089e01634b7e34a1c005080099ce--