Oct-07-2017, 08:59 AM
I managed, with help from this site and the book 'Automate the Boring Stuff', to write several little routines. To my utter amazement, they all now work.
I start with an excel file that contains student names and numbers. (I have to do this every new term)
1. I resize the students' photos.
2. put the photos in the excel table
3. read in scores from tests each week (they come from a marking program), inserting new columns and add up the scores for each test.
I want to string these steps together to do everything in one program.
From what I read, I should define each separate routine as a function, then declare a main() which contains each routine.
Is that correct?
A problem for me is openpyxl: it does not load any images and when saved, the images in the original excel file are gone. Therefore, I need to do everything from scratch each time I add data to my main excel file. Not a problem if I can run all the routines in 1 main().
I start with an excel file that contains student names and numbers. (I have to do this every new term)
1. I resize the students' photos.
2. put the photos in the excel table
3. read in scores from tests each week (they come from a marking program), inserting new columns and add up the scores for each test.
I want to string these steps together to do everything in one program.
From what I read, I should define each separate routine as a function, then declare a main() which contains each routine.
Is that correct?
A problem for me is openpyxl: it does not load any images and when saved, the images in the original excel file are gone. Therefore, I need to do everything from scratch each time I add data to my main excel file. Not a problem if I can run all the routines in 1 main().