load Function

Defined in pyglet.text

load(filename, file=None, mimetype=None)

Load a document from a file.

Parameters:
  • filename (str) – Filename of document to load.
  • file (file-like object) – File object containing encoded data. If omitted, filename is loaded from disk.
  • mimetype (str) – MIME type of the document. If omitted, the filename extension is used to guess a MIME type. See get_decoder for a list of supported MIME types.
Return type:

AbstractDocument

Previous topic

get_decoder Function

Next topic

pyglet.window