Sep-10-2017, 10:42 PM
As a beginner, I have almost done what I want to do.
I can use python to resize photos, resize the excel table row heights, put photos in each row of column A. I can do that now.
But of course, I need the photos to match the names. Now I just need to match the photo with the name in column C.
I have a photo say 'fred.jpg' I want this photo in column 1 of the table. Somewhere in column C is the name 'fred'. (Actually all the names are Chinese.)
In this loop, let's say fred.jpg is the first filename
1 For each filename which has the format 'name.jpg' get the string 'name'
2 Find that name in column C.
3 Get the row number of that name
4 put the photo in column A of that name row number
I'm not sure how to get the string name from name.jpg The rest I can do I think.
Next month I will get another 4 classes, about 160 students, I'm fed up doing this manually! Python to the rescue!
I can use python to resize photos, resize the excel table row heights, put photos in each row of column A. I can do that now.
But of course, I need the photos to match the names. Now I just need to match the photo with the name in column C.
I have a photo say 'fred.jpg' I want this photo in column 1 of the table. Somewhere in column C is the name 'fred'. (Actually all the names are Chinese.)
In this loop, let's say fred.jpg is the first filename
for filename in os.listdir(pathToFiles): if not (filename.endswith(fileEnding)): continueTODO
1 For each filename which has the format 'name.jpg' get the string 'name'
2 Find that name in column C.
3 Get the row number of that name
4 put the photo in column A of that name row number
I'm not sure how to get the string name from name.jpg The rest I can do I think.
Next month I will get another 4 classes, about 160 students, I'm fed up doing this manually! Python to the rescue!