How to fix those errors?

Roy Smith roy at
Sun Nov 16 23:06:40 CET 2014

In article <mailman.15913.1416175276.18130.python-list at>,
 Chris Angelico <rosuav at> wrote:

> On Mon, Nov 17, 2014 at 8:32 AM, Abdul Abdul <abdul.sw84 at> wrote:
> > from PIL import Image
> > import os
> >
> >     for inputfile in filelist
> >     outputfile = os.path.splitext(inputfile)[0]+".jpg"
> >     if inputfile != outputfile:
> >         try:
> >   
> >             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

Not to mention the missing ":" at the end of the "for" statement.  
Please, people, when asking questions about code, copy-paste what you're 
running into your post.  Then we see exactly what you've got, and at 
least have a chance of figuring out what's wrong.

More information about the Python-list mailing list