ANN: path module 1.1.3
Jason Orendorff
jason@jorendorff.com
17 Feb 2003 17:00:43 -0800
path.py provides an object for working with files and directories.
Less typing than os.path, more fun, a few new tricks.
Download path.py version 1.1.3:
http://www.jorendorff.com/articles/python/path
New features since version 1.0:
- Wraps more functions from os.path.
- Now wraps functionality from the os module: rename(), mkdir(),
stat(), and so on.
- Also wraps glob and shutil modules. Methods include glob(),
copy(), copytree(), rmtree(), etc.
- New convenience methods:
p.files() and p.dirs() for listing directory contents.
p.bytes(), p.text(), p.lines() for reading in whole files
with a single method call.
p.touch() imitates the Unix 'touch' command.
- Bug fixes; test suite.
Quick example:
import os
from path import path
home = path(os.environ['HOME'])
for f in home.walkfiles():
if f.endswith('~'):
f.remove()
Please send feedback to jason at jorendorff dot com.
<P><A HREF="http://www.jorendorff.com/articles/python/path/index.html">path
1.1.3</a> - Python <code>path</code> module, a convenient object for
working with files and directories.