I’m building a version control module for my network and this is what I have so far:
import os, plistlib
def cyberduck():
path=('/Applications/Cyberduck.app/Contents/Info.plist')
pl = plistlib.readPlist(path)
pl['key']=0
for key in pl.values():
if (key=='4.2.1'):
print("We're good!")
else:
print("No good")
import cyberduck_install
The loop will find the version string(‘4.2.1’), but will also find all the non version strings. How do I code the loop so that if (‘4.2.1’) exists it will return true and only print (“We’re good!”) and if (‘4.2.1’) does not exist anywhere, it will return false and only print (“No good”) once?
Am I missing something? Is this all you want: