0

I am just a beginner in Python. So help me learn and write the code for a small but complex problem. I've tried many things but I am lost where to start with and go:

Problem:

I have a folder and its subfolders with heaps of different product images(let's say in .jpeg and .png). I want to compile a single pdf of all these photos with links/location of these photos in the pdf. This list and photos could be in the form of a table or a very simple format.

I am doing it because sometimes I forget the product name so I have to look at its image by going into each folder and sub-folder. This will give me an opportunity to look at all the photos in these folders and sub-folder without opening them one-by-one.

Miroslav Glamuzina
  • 4,472
  • 2
  • 19
  • 33
sums
  • 1

1 Answers1

0

Your issue breaks down into 3 steps.

1-Search the directories for files (which you can use the os module's walk()). here is a great tutorial:

https://www.pythoncentral.io/how-to-traverse-a-directory-tree-in-python-guide-to-os-walk/

2-add the found files into a list of tuples having path of the image and the name of it.

3- Add these images into a single pdf file. You can use python module fpdf to do this. And this has been addressed already here:

Create PDF from a list of images

RockAndRoleCoder
  • 320
  • 2
  • 10