Saving State

What is a program's state?

The program's state is the set of values of all the variables at a given moment. Saving state refers to saving these values so they can be recovered if the program crashes or the user closes it.

What is the JSON format?

JSON (JavaScript Object Notation) is a way of storing data that's easy for programs to read back. They're used as a common way to save a program's state. Originally developed for use in JavaScript programs, JSON is now used by many programming languages.

Why is JSON used to save state?

The JSON format can be read by both humans and programs. Some simple JSON data files look just like Python code. Python has libraries you can use to simplify reading and writing JSON files.