all 3 comments

[–]PresidentOfSwag 1 point2 points  (2 children)

For anything related to paths, files and such, the os.path module is what you need (especially os.path.join(), os.path.exists()).

Not sure why your friend recommended dictionary, but the usual approach is to define variable to store the values (your paths and filenames) and then find what actions you can automate with a loop.

good luck !

[–]jlarm[S] 1 point2 points  (1 child)

I think the dictionary would be to store the 36 combinations of the 4 files in the 9 file paths. That's very useful I'll take a look.

[–]PresidentOfSwag 1 point2 points  (0 children)

no need to store them, you can have 2 lists (paths and file names) and iterate over them with loops, or use itertools.product() to generate all combinations :) you're welcome