Python csv.DictReader and DictWriter: Read and Write CSV Files by Column Name
Read and write CSV in Python by column name with csv.DictReader and DictWriter. newline='', Excel BOM, missing columns, extrasaction and real examples.
Notes
Security notes, SOC lab write-ups and tested code by Mahir Faysal, a SOC Level 1 cybersecurity learner in Bangladesh, plus notes from my Next.js and Gemini projects. Sample posts are marked and drafts stay in the admin area.
Read and write CSV in Python by column name with csv.DictReader and DictWriter. newline='', Excel BOM, missing columns, extrasaction and real examples.
Use PHP PDO transactions safely: beginTransaction, commit, rollBack in try/catch, a bank transfer example, inTransaction(), and the MySQL implicit commit trap.
Insert a row with PHP PDO prepared statements and get the new ID with lastInsertId(). MySQL, PostgreSQL RETURNING, SQLite, bulk inserts and common mistakes.
To secure an SSH server, switch to SSH key authentication, disable password and root logins in /etc/ssh/sshd_config, limit which users can log in, firewall port 22 to trusted addresses where possible, add fail2ban, and keep OpenSSH updated.
To check if your email was breached, go to haveibeenpwned.com, type your email address and press "Check". The site lists every known data breach that included your address, along with what data was exposed.
To convert a decimal number to binary, divide it by 2 repeatedly and write down each remainder, then read the remainders from bottom to top. For example, 13 ÷ 2 gives remainders 1, 0, 1, 1, so 13 in binary is 1101.
0%