Reading Code Examples

Prev: Part 3: Using the Visualizer

This short guide explains how to read the line-diff examples used throughout the documentation.


How to read the examples

All examples in this guide are shown as line diffs:

  • Green lines (with a +) are lines you need to add/insert at this step.
  • Red lines (with a -) are lines you need to remove.
  • All other lines (no + or -) stay exactly the same.

On the left side of each diff, you will see line numbers. These show the line numbers before and after the change so you can locate where the update should happen.

Diff example

Before (starting file):

Diff (what to change in this step):

After (what your file should look like after):


Now that you know how to read the code diffs, let’s walk through a minimal example using PyMFCAD.

Next: Part 4b: Hello World Component