python-clinic / Doc / library / pipes.rst

Full commit

:mod:`pipes` --- Interface to shell pipelines

Source code: :source:`Lib/`

The :mod:`pipes` module defines a class to abstract the concept of a pipeline --- a sequence of converters from one file to another.

Because the module uses :program:`/bin/sh` command lines, a POSIX or compatible shell for :func:`os.system` and :func:`os.popen` is required.

The :mod:`pipes` module defines the following class:

An abstraction of a pipeline.


>>> import pipes
>>> t = pipes.Template()
>>> t.append('tr a-z A-Z', '--')
>>> f ='pipefile', 'w')
>>> f.write('hello world')
>>> f.close()
>>> open('pipefile').read()

Template Objects

Template objects following methods: