Sheet ⁨20⁩ · ⁨Series⁩Surveyed ⁨2026⁩
Series

Python Snippets

Back to Series

Python Snippets

2parts, in order. Start at the top.

CodeSnippets

2 items
Python Async HTTP Requests with aiohttp: Fetch Multiple URLs Concurrently

Python Async HTTP Requests with aiohttp: Fetch Multiple URLs Concurrently

Quick Tip Reuse one aiohttp session, fan your requests out with asyncio.gather, and cap them with a semaphore to fetch hundreds of URLs in the time one loop would take. The Problem **The

Python Subprocess: Run Shell Commands Safely and Capture Output

Python Subprocess: Run Shell Commands Safely and Capture Output

Quick Tip Pass a list, never a string, and subprocess never starts a shell at all. That one habit removes an entire category of vulnerability from your automation. The Problem Every sc