Automation with Python — a practical guide to Python automation with clear examples you can reuse in real projects.
Python Tutorial Series (85/95). Prefer one article? Read the complete Python tutorial.
Short description
Python shines at glue code — combining files, APIs, and OS tasks into one script.
Rename files sketch
from pathlib import Path
folder = Path('invoices')
for i, path in enumerate(folder.glob('*.pdf'), start=1):
path.rename(folder / f'invoice-{i:03d}.pdf')