plistlib.dump()

plistlib.dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False)

Write value to a plist file. Fp should be a writable, binary file object.

The fmt argument specifies the format of the plist file and can be one of the following values:

  • FMT_XML: XML formatted plist file
  • FMT_BINARY: Binary formatted plist file

When sort_keys is true (the default) the keys for dictionaries will be written to the plist in sorted order, otherwise they will be written in the iteration order of the dictionary.

When skipkeys is false (the default) the function raises TypeError when a key of a dictionary is not a string, otherwise such keys are skipped.

A TypeError will be raised if the object is of an unsupported type or a container that contains objects of unsupported types.

An OverflowError will be raised for integer values that cannot be represented in (binary) plist files.

New in version 3.4.

doc_python
2016-10-07 17:40:49
Comments
Leave a Comment

Please login to continue.