GNU Info

Info Node: (python2.1-lib.info)pipes

(python2.1-lib.info)pipes


Next: posixfile Prev: fcntl Up: Unix Specific Services
Enter node , (file) or (file)node

Interface to shell pipelines
============================

This manual section was written by Moshe Zadka
<moshez@zadka.site.co.il>.
A Python interface to UNIX shell pipelines.

The `pipes' module defines a class to abstract the concept of a
_pipeline_ -- a sequence of convertors from one file to another.

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

The `pipes' module defines the following class:

`Template()'
     An abstraction of a pipeline.

Example:

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

Template Objects

automatically generated by info2www version 1.2.2.9