Concactated filenames

“”"Hi Everybody:

I am having a strange time opening files with strings that I concatenate.
I want to iterate through the files in a directory but as I commented below, the string works fine, but the same thing does not when assembled from chunks.
(I get the same results with Idle)
any ideas?"""

import PIL
from PIL import Image

string = “C:/Documents and Settings/cc/Desktop/Website/WedgeL/WedgeL0101.jpg”
pre = “C:/Documents and Settings/cc/Desktop/Website/WedgeL/WedgeL”
zero = str(0)
num = str(100)
ext = “.jpg”
concatcate = pre + zero + num + ext

#This works fine#
im =

#This does not
#im =

ki =im.transpose (Image.FLIP_LEFT_RIGHT)

print concatenate

You do notice that in ‘string’ it ends in 101, not 100 as in ‘concatenate’ correct? That’s the only difference I can see, unless you post what gets printed as concatenate at the end.

Good observation forTe, this is calling an image to a directory with a hundred or so .JPGs
including 0100, 0101, 0102 ect … Double checked that.

The error is not that python cannot find the file ,it’s there and python see’s it.

Him say:
File “C:\Python25\lib\site-packages\PIL\”, line 1916, in open
raise IOError(“cannot identify image file”)
IOError: cannot identify image file

there is something that python perceives differently in my concatenated string and my typed one.

(By the way that concatation is in line 12)