-
Course Orientation
-
Python Fundamentals
-
Database Query (SQL & PostgreSQL)
-
FastAPI + Odoo Integration
-
Odoo Architecture & Dev Environment Setup
-
Creating Your First Custom Module
-
Models & Fields — The Odoo ORM
-
Computed Fields, Constraints & Onchange
-
ORM Methods & Recordset Operations
-
Form & List Views — XML Architecture
-
Search Views, Filters & Group By
-
View Inheritance & Module Extension
-
Business Methods, Workflows & Status Bars
-
Wizards (TransientModel)
-
Security — Groups, Access Rights & Record Rules
-
QWeb Reports — PDF & Print Layouts
-
Scheduled Actions & Automated Rules
-
External API & JSON-RPC Deep Dive
-
On-Prem & Cloud Deployment
-
Capstone — Full Custom Module Build
File Handling & Exceptions
Real programs read files and survive bad input — here is how to do both cleanly.
Key topics
- The
with open(...) as fpattern; read/write/append modes; text vs binary. - Reading line by line,
read()vsreadlines(); writing andjson/csvmodule basics. - Exceptions: try/except/else/finally; catching specific exceptions; raising with
raise; custom exception classes. - EAFP vs LBYL styles; the exception hierarchy; never bare
except:. - Path handling with
pathlib.
Exercise / deliverable
Write expenses.py: load a CSV of expenses, skip malformed rows with per-row error messages, compute totals per category, and write a JSON summary — then handle a missing file gracefully.
Level: Beginner | Duration: ~0.5h. Reading and writing files safely, and handling errors with try/except instead of crashing.
Rating
0
0
There are no comments for now.