16.11 pipes -- Interface to shell pipelinesAvailability: Unix. The 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 /bin/sh command lines, a POSIX or compatible shell for os.system() and os.popen() is required. The pipes module defines the following class:
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'
See About this document... for information on suggesting changes. |