def writePlist(rootObject, pathOrFile):
 didOpen = 0
 if isinstance(pathOrFile, (str, unicode)):
  pathOrFile = open(pathOrFile, 'w')
  didOpen = 1
 writer = PlistWriter(pathOrFile)
 writer.writeln('<plist version="1.0">')
 writer.writeValue(rootObject)
 writer.writeln('</plist>')
 if didOpen:
  pathOrFile.close()

def writePlist ( rootObject , pathOrFile ) : didOpen = 0 if isinstance ( pathOrFile , ( str , unicode ) ) : pathOrFile = open ( pathOrFile , 'w' ) didOpen = 1 writer = PlistWriter ( pathOrFile ) writer . writeln ( '<plist version="1.0">' ) writer . writeValue ( rootObject ) writer . writeln ( '</plist>' ) if didOpen : pathOrFile . close ( )
write rootobject to a .