The pygame2.sdl.rwops C API contains objects for accessing SDL_RWops from Python objects.
Note
All Python objects to be used by the pygame2.sdl.rwops API must support binary read and write access. This is especially important for Python 3.x users.
Include headers:
pygame2/pgsdl.h
Creates a read-only SDL_RWops object from the passed Python object. obj must be some file-like or buffer-like object supporting the binary read, seek, tell and close methods to be fully usable as SDL_RWops. canautoclose indicates, whether the object can be automatically closed by the matching RW function. If not, a manual call to PyRWops_Close() will be required. On failure, this returns NULL.
Note
This function is not suitable for threaded usage.
Creates a read-write SDL_RWops object from the passed Python object. obj must be some file-like or buffer-like object supporting the binary read, seek, tell and close methods to be fully usable as SDL_RWops. canautoclose indicates, whether the object can be automatically closed by the matching RW function. If not, a manual call to PyRWops_Close() will be required. On failure, this returns NULL.
Note
This function is not suitable for threaded usage.
Creates a read-only SDL_RWops object from the passed Python object. obj must be some file-like or buffer-like object supporting the binary read, seek, tell and close methods to be fully usable as SDL_RWops. canautoclose indicates, whether the object can be automatically closed by the matching RW function. If not, a manual call to PyRWops_Close() will be required. On failure, this returns NULL.
Note
If Python was built without thread support, this will default to PyRWops_NewRO().
Creates a read-write SDL_RWops object from the passed Python object. obj must be some file-like or buffer-like object supporting the binary read, seek, tell and close methods to be fully usable as SDL_RWops. canautoclose indicates, whether the object can be automatically closed by the matching RW function. If not, a manual call to PyRWops_Close() will be required. On failure, this returns NULL.
Note
If Python was built without thread support, this will default to PyRWops_NewRO().