package scipy

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

Text I/O implementation using an in-memory buffer.

The initial_value argument sets the value of object. The newline argument is like the one of TextIOWrapper's constructor.

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

Implement iter(self).

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

Close the IO object.

Attempting any further operation after the object is closed will raise a ValueError.

This method has no effect if the file is already closed.

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

Flush write buffers, if applicable.

This is not implemented for read-only and non-blocking streams.

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

Retrieve the entire contents of the object.

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

Return whether this is an 'interactive' stream.

Return False if it can't be determined.

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

Read at most size characters, returned as a string.

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

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

Returns True if the IO object can be read.

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

Read until newline or EOF.

Returns an empty string if EOF is hit immediately.

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

Return a list of lines from the stream.

hint can be specified to control the number of lines read: no more lines will be read if the total size (in bytes/characters) of all lines so far exceeds hint.

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

Change stream position.

Seek to character offset pos relative to position indicated by whence: 0 Start of stream (the default). pos should be >= 0; 1 Current position - pos must be 0; 2 End of stream - pos must be 0. 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

Tell the current file position.

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

Truncate size to pos.

The pos argument defaults to the current file position, as returned by tell(). The current file position is unchanged. Returns the new absolute position.

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

Returns True if the IO object can be written.

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

Write string to file.

Returns the number of characters written, which is always equal to the length of the string.

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

Write a list of lines to stream.

Line separators are not added, so it is usual for each of the lines provided to have a line separator at the end.

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 : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.