Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « io » Python 3.11.3

Classe « TextIOWrapper »

Informations générales

Héritage

builtins.object
    _IOBase
        _TextIOBase
            TextIOWrapper

Définition

class TextIOWrapper(_TextIOBase):

help(TextIOWrapper)

Character and line based layer over a BufferedIOBase object, buffer.

encoding gives the name of the encoding that the stream will be
decoded or encoded with. It defaults to locale.getencoding().

errors determines the strictness of encoding and decoding (see
help(codecs.Codec) or the documentation for codecs.register) and
defaults to "strict".

newline controls how line endings are handled. It can be None, '',
'\n', '\r', and '\r\n'.  It works as follows:

* On input, if newline is None, universal newlines mode is
  enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
  these are translated into '\n' before being returned to the
  caller. If it is '', universal newline mode is enabled, but line
  endings are returned to the caller untranslated. If it has any of
  the other legal values, input lines are only terminated by the given
  string, and the line ending is returned to the caller untranslated.

* On output, if newline is None, any '\n' characters written are
  translated to the system default line separator, os.linesep. If
  newline is '' or '\n', no translation takes place. If newline is any
  of the other legal values, any '\n' characters written are translated
  to the given string.

If line_buffering is True, a call to flush is implied when a call to
write contains a newline character.

Constructeur(s)

Signature du constructeur Description
__new__(*args, **kwargs) Create and return a new object. See help(type) for accurate signature. [extrait de __new__.__doc__]
__init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. [extrait de __init__.__doc__]

Liste des attributs statiques

Nom de l'attribut Valeur
buffer
closed
encoding
errors
line_buffering
name
newlines
write_through

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__next__(self) Implement next(self). [extrait de __next__.__doc__]
__repr__(self) Return repr(self). [extrait de __repr__.__doc__]
close(self)
detach(self)
fileno(self)
flush(self)
isatty(self)
read(self, size=-1)
readable(self)
readline(self, size=-1)
reconfigure(self, /, *, encoding=None, errors=None, newline=None, line_buffering=None, write_through=None) Reconfigure the text stream with new parameters. [extrait de reconfigure.__doc__]
seek(self, cookie, whence=0)
seekable(self)
tell(self)
truncate(self, pos=None)
writable(self)
write(self, text)

Méthodes héritées de la classe _TextIOBase

__init_subclass__, __subclasshook__

Méthodes héritées de la classe _IOBase

__del__, __enter__, __exit__, __iter__, readlines, writelines

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__