Developpez.com

Python

Choisissez la catégorie, puis la rubrique :

33.1.4 Writer Implementations


33.1.4 Writer Implementations

Three implementations of the writer object interface are provided as examples by this module. Most applications will need to derive new writer classes from the NullWriter class.

class NullWriter( )
A writer which only provides the interface definition; no actions are taken on any methods. This should be the base class for all writers which do not need to inherit any implementation methods.

class AbstractWriter( )
A writer which can be used in debugging formatters, but not much else. Each method simply announces itself by printing its name and arguments on standard output.

class DumbWriter( [file[, maxcol = 72]])
Simple writer class which writes output on the file object passed in as file or, if file is omitted, on standard output. The output is simply word-wrapped to the number of columns specified by maxcol. This class is suitable for reflowing a sequence of paragraphs.

See About this document... for information on suggesting changes.
Microsoft publie l'édition de juin 2019 de l'extension Python pour Visual Studio Code, elle inclut 70 correctifs et son lot de nouveautés
Le neuvième week-end de programmation de jeux vidéo sur Developpez.com
Programmation : une étude révèle les langages les plus voraces en énergie, Perl, Python et Ruby en tête, C, Rust et C++, les langages les plus verts
Apprendre les notions avancées en Cython, un tutoriel de Gabor Laszlo Hajba traduit par l'équipe de rédaction
Contacter le responsable de la rubrique Python

Partenaire : Hébergement Web