I am trying to find a way to access the plist file: /Library/Preferences/com.apple.iPod.plist to access the serial numbers in it.
Here is my current code--
import os
import plistlib
fileName=os.path.expanduser('/Users/Ryan/Library/Preferences/com.apple.iPod.plist')
pl=plistlib.readPlist(fileName)
for left, right in pl.items():
for values in right.values():
print(values['Serial Number'])
I keep getting the results but some quick errors pop up as well. I get this one:
plist.py:8: DeprecationWarning: The readPlist function is deprecated, use load() instead pl=plistlib.readPlist(fileName)
and also this one:
File "plist.py", line 16, in <module>
for values in right.values():
AttributeError: 'bool' object has no attribute 'values'
I am guessing the using the load function is fairly simple, although I have had a hard time figuring it out using the tutorials I have found online to modify it for my needs.
Regarding the boolean AttributeError, I have no idea what I am doing wrong.
Thanks!