How to read from and write to .plist files using Python – St. Ignatius College Prep Tech Blog

Thank you, thank you, thank you, Alan! If you’re looking for a quick set of tips on how to get up to speed using Python for macOS administration, this is super helpful for playing with plists:

If you follow the examples in the documentation, though, you may run into some errors.For example, if you paste in the code on how to generate a .plist (even if you import datetime, plistlib, and time), you’ll get an error ofNameError: name ‘fileName’ is not definedand then if you actually define fileName with the past to a file, you’ll getNameError: name ‘dump’ is not definedNow I get that probably dump needs to be imported from some other module, but seriously in documentation you need to have code that people can copy and paste and see the results of and tweak, instead of having code that’s basically useless.

Source: How to read from and write to .plist files using Python – St. Ignatius College Prep Tech Blog