Page 106 - Beginning Programming with Pyth - John Paul Mueller
P. 106

 Even though Notebook won’t display multiple checkpoints, you can keep multiple checkpoints if desired. Simply rename the existing checkpoint and then create a new one. For example, if you name the existing checkpoint BPPD_04_Comments-checkpoint.ipynb, you might rename it to BPPD_04_Comments-checkpoint1.ipynb before you create a new save. To use an older checkpoint, you must rename it back to the original name of checkpoint.ipynb.
Saving a checkpoint
To save a checkpoint, you choose File ⇒ Save and Checkpoint. Notebook automatically saves a copy of the existing notebook in the .ipynb_checkpoints folder using the same name with -checkpoint added. Unless you specifically rename the existing checkpoint, the manual or automatic save will overwrite the existing file. Consequently, all you ever see is a single checkpoint file unless you rename older files manually.
Restoring a checkpoint
To restore a checkpoint, choose the entry found on the File ⇒ Revert to Checkpoint menu. This menu makes it appear that you can have more than one checkpoint file, but the menu never has more than one entry in it. The entry does contain the date and time that you created the checkpoint.
Manipulating Cells
Cells are what make Notebook considerably different from using other IDEs. By using the functionality that cells provide, you can perform all sorts of application manipulations that would otherwise be difficult or error prone using other IDEs, such as moving related code around as a chunk, rather than line-by-line. Chapter 4 shows you a few quick tricks for working with cells. The following sections provide additional techniques that you can use to make cells truly useful.
Adding various cell types
Notebook gives you access to several different cell types. You find out
 

























































































   104   105   106   107   108