package scipy

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Six.StringIOSource

Sourcetype tag = [
  1. | `StringIO
]
Sourcetype t = [ `Object | `StringIO ] Obj.t
Sourceval of_pyobject : Py.Object.t -> t
Sourceval to_pyobject : [> tag ] Obj.t -> Py.Object.t
Sourceval 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.

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

Implement iter(self).

Sourceval 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.

Sourceval 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.

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

Flush write buffers, if applicable.

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

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

Retrieve the entire contents of the object.

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

Return whether this is an 'interactive' stream.

Return False if it can't be determined.

Sourceval 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.

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

Returns True if the IO object can be read.

Sourceval 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.

Sourceval 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.

Sourceval 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.

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

Returns True if the IO object can be seeked.

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

Tell the current file position.

Sourceval 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.

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

Returns True if the IO object can be written.

Sourceval 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.

Sourceval 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.

Sourceval to_string : t -> string

Print the object to a human-readable representation.

Sourceval show : t -> string

Print the object to a human-readable representation.

Sourceval pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.