The PIL.ContainerIO Module

ContainerIO(file, offset, length) (class) [#]

A file object that provides read access to a part of an existing file (for example a TAR file).

For more information about this class, see The ContainerIO Class.

The ContainerIO Class

ContainerIO(file, offset, length) (class) [#]

A file object that provides read access to a part of an existing file (for example a TAR file).

__init__(file, offset, length) [#]

Create file object.

file
Existing file.
offset
Start of region, in bytes.
length
Size of region, in bytes.

isatty() [#]

Always false.

read(bytes=0) [#]

Read data.

bytes
Number of bytes to read. If omitted or zero, read until end of region.
Returns:
An 8-bit string.

readline() [#]

Read a line of text.

Returns:
An 8-bit string.

readlines() [#]

Read multiple lines of text.

Returns:
A list of 8-bit strings.

seek(offset, mode=0) [#]

Move file pointer.

offset
Offset in bytes.
mode
Starting position. Use 0 for beginning of region, 1 for current offset, and 2 for end of region. You cannot move the pointer outside the defined region.

tell() [#]

Get current file pointer.

Returns:
Offset from start of region, in bytes.