package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `BytesIO
]
type t = [ `BytesIO | `Object ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : ?initial_bytes:Py.Object.t -> unit -> t

Buffered I/O implementation using an in-memory bytes buffer.

val __iter__ : [> tag ] Obj.t -> Py.Object.t

Implement iter(self).

val close : [> tag ] Obj.t -> Py.Object.t

Disable all I/O operations.

val detach : [> tag ] Obj.t -> Py.Object.t

Disconnect this buffer from its underlying raw stream and return it.

After the raw stream has been detached, the buffer is in an unusable state.

val fileno : [> tag ] Obj.t -> Py.Object.t

Returns underlying file descriptor if one exists.

OSError is raised if the IO object does not use a file descriptor.

val flush : [> tag ] Obj.t -> Py.Object.t

Does nothing.

val getbuffer : [> tag ] Obj.t -> Py.Object.t

Get a read-write view over the contents of the BytesIO object.

val getvalue : [> tag ] Obj.t -> Py.Object.t

Retrieve the entire contents of the BytesIO object.

val isatty : [> tag ] Obj.t -> Py.Object.t

Always returns False.

BytesIO objects are not connected to a TTY-like device.

val read : ?size:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Read at most size bytes, returned as a bytes object.

If the size argument is negative, read until EOF is reached. Return an empty bytes object at EOF.

val read1 : ?size:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Read at most size bytes, returned as a bytes object.

If the size argument is negative or omitted, read until EOF is reached. Return an empty bytes object at EOF.

val readable : [> tag ] Obj.t -> Py.Object.t

Returns True if the IO object can be read.

val readinto : buffer:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Read bytes into buffer.

Returns number of bytes read (0 for EOF), or None if the object is set not to block and has no data to read.

val readinto1 : buffer:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

None

val readline : ?size:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Next line from the file, as a bytes object.

Retain newline. A non-negative size argument limits the maximum number of bytes to return (an incomplete line may be returned then). Return an empty bytes object at EOF.

val readlines : ?size:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

List of bytes objects, each a line from the file.

Call readline() repeatedly and return a list of the lines so read. The optional size argument, if given, is an approximate bound on the total number of bytes in the lines returned.

val seek : ?whence:Py.Object.t -> pos:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Change stream position.

Seek to byte offset pos relative to position indicated by whence: 0 Start of stream (the default). pos should be >= 0; 1 Current position - pos may be negative; 2 End of stream - pos usually negative. Returns the new absolute position.

val seekable : [> tag ] Obj.t -> Py.Object.t

Returns True if the IO object can be seeked.

val tell : [> tag ] Obj.t -> Py.Object.t

Current file position, an integer.

val truncate : ?size:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Truncate the file to at most size bytes.

Size defaults to the current file position, as returned by tell(). The current file position is unchanged. Returns the new size.

val writable : [> tag ] Obj.t -> Py.Object.t

Returns True if the IO object can be written.

val write : b:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Write bytes to file.

Return the number of bytes written.

val writelines : lines:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Write lines to the file.

Note that newlines are not added. lines can be any iterable object producing bytes-like objects. This is equivalent to calling write() for each element.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Stdlib.Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.