An interactive lesson page explaining Python exception handling with try-except, covering what exceptions are, how to catch and inspect them, and how to raise them, used by learners to study error handling concepts with in-page explanations and examples.
Topics
This module covers 7 topics. Open a topic to see its subtopics.
Module Content
13 items.
-
-
An interactive lesson page introducing Python modules, covering what a module is, how to import them, how to create custom modules, and how the Python path works, used by learners to read and interact with foundational module concepts.
-
An interactive lesson page covering file I/O using Python's with statement, explaining file modes, the open() function, reading methods, and path handling, used by learners to study how to safely and reliably work with files in Python.
-
This artifact is a curated reference page that points learners to official and supplementary documentation resources for Python's `csv` module and JSON handling, covering how to read and write CSV files and work with JSON data; learners would use it to access authoritative references while completing file I/O exercises, and instructors would use it to direct students to reliable external sources for these topics.
-
Explains what a Python module is and how the various import forms (import, from…import, aliasing) let you reuse code from the standard library such as math, random, os, and sys; learners read it to understand the basics of importing before writing their own modules.
-
Shows how to turn any .py file into a reusable custom module so unit-conversion functions, constants, and helpers can be imported across engineering scripts; used as a how-to guide for organizing code into separate files.
-
Surveys five commonly used standard library modules (such as math, os, sys, datetime, and random) with examples of computing values, listing folders, reading command-line arguments, and time-stamping records; learners use it as a reference for ready-made functionality.
-
Introduces file input and output with the built-in open() function and the with statement for safely reading, writing, and appending text files so data persists between program runs; used to practice logging results and reading configuration or data files.
-
Covers reading and writing CSV tabular data in Python, explaining the plain-text row-and-comma structure and the csv module tools for handling spreadsheet, lab-instrument, and sensor exports; learners use it to import and export engineering data sets.
-
Explains the JSON format and how it maps to Python dictionaries and lists, along with loading and dumping structured data to and from files or strings; used when exchanging configuration or web/API data in a readable format.
-
Teaches defensive programming with try-except blocks to catch missing files, bad input types, and division-by-zero errors so scripts fail gracefully instead of crashing; learners apply it to make data-processing scripts robust.
-
Combined module page that assembles all topics — Python modules, custom modules, standard library modules, file I/O with the with statement, CSV files, JSON, and try-except error handling — into one continuous reading for review or printing.
-
A 2–4 hour problem-solving assignment in which learners write Python code to apply the van der Waals equation of state to real experimental gas data, practising modules, file I/O, and error handling while comparing model predictions to measured values, submitted as a Colab notebook or written report.