==================== ``grail.pyz`` Module ==================== .. include:: ..\version.h *New in version 5.10.* .. contents:: Table of Contents :backlinks: top -------- Overview -------- This module is designed to provide a common helper function when working with (or within) PYZ modules. --------- Functions --------- :df:`get_data(_name_, _file_, rel_path)`: Supply the built-in __name__ and __file__, as well as the "relative path" that wish to load. This will return the data as a binary string (meaning no CRLF changes for text files). As an example, if you had a script called :file:`script.py`, and .. python:: mylogo = pyz.get_data(__name__, __file__, "mylogo.png") and mylogo will contain the binary data of that file as a binary string. This function doesn't care if you are a packaged or unpackaged module. The purpose of this function is to let you abstract out all the ideas involved in loading resource files. If your module is a package residing in memory, the data will also be loaded from memory.