Exclusive moments.
A milestone achieved, Officially a graduate! 🎓
BSc. Chemistry. 🧪
From student to graduate, and now officially a CHEMIST! 🥼⚗️
The journey was worth it. ❤️
Backend developers, which database would you choose for your next serious project?
A. MySQL
B. PostgreSQL
28
Bless Wizdom 💎 retweeted
PYTHON AUTOMATION !!!!
Reading a PDF File with Python 🐍📄
Today, let’s talk about PDF automation using Python.
I’m starting with an existing invoice PDF, then installed the pypdf library to work with PDF files.
Here’s what I did:
1. from pypdf import PdfReader – Imported PdfReader from the pypdf library.
2. reader = PdfReader("invoice.pdf") – Opened and loaded my invoice PDF.
3. print(len(reader.pages)) – Counted and displayed the total number of pages in the PDF.
4. page = reader.pages[0] – Accessed the first page of the invoice.
5. text = page.extract_text() – Extracted the text from the first page.
6. print(text) – Displayed the extracted text in the terminal.
With just a few lines of Python, I was able to open a PDF, count its pages, and extract its text.
One step at a time, one automation project at a time. 🚀
#Python #PythonAutomation #PDFAutomation #100DaysOfCode


