(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/template-objects.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/unix.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/module-fcntl.html| ]]
|
Python Library Reference
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/contents.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/modindex.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/genindex.html| ]]
|
Next: 8.13.1 Template Objects Up: 8. Unix Specific Services Previous: 8.12 fcntl
8.13 pipes -- Interface to shell pipelines
Availability: Unix.
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'
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/template-objects.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/unix.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/module-fcntl.html| ]]
|
Python Library Reference
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/contents.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/modindex.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/genindex.html| ]]
|
Next: 8.13.1 Template Objects Up: 8. Unix Specific Services Previous: 8.12 fcntl
Send comments on this document to python-docs@python.org.