How to fix those errors?

Abdul Abdul abdul.sw84 at gmail.com
Sun Nov 16 16:32:26 EST 2014


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141116/398023f8/attachment.html>


More information about the Python-list mailing list