Reputation: 1004
My iPhone app has App Version number in Info.plist. I need a python script to read the App Version from it and print both?
I have printed the plist file. Below is the code
for file in os.walk(FOLDERPATH):
inFile = open('Info.plist', 'rt')
for line in inFile:
print(inFile.read())
Upvotes: 6
Views: 14567
Reputation: 2013
Updated plistlib example for Python3:
import plistlib
file_name = "/Users/Dave/Info.plist"
with open(file_name, 'rb') as infile:
plist = plistlib.load(infile)
print(plist["aKey"])
Upvotes: 2
Reputation:
I found this. I believe its what you're looking for. Hope it helps! http://docs.python.org/dev/library/plistlib.html
Upvotes: 10
Reputation:
Slightly adapted plistlib example:
import plistlib
pl = plistlib.readPlist("Info.plist")
item = pl["aKey"]
Upvotes: 10