equivalent of Ruby's Pathname?
phlip2005 at gmail.com
Tue Mar 16 17:12:08 CET 2010
Chris Rebert wrote:
> The next closest thing would probably be the Python Cookbook:http://code.activestate.com/recipes/langs/python/
One thing I really like about ... my hacked version of path.py ... is
path.cd( lambda: ... ). It works great inside fabfile.py to
temporarily switch to a different folder:
sample_project = path('sample_project').abspath()
_sh('python manage.py runserver 0.0.0.0:8000 --
After the lambda runs, we exception-safely return to the home folder.
(BTW I'm aware that a fabfile.py command with only one statement will
return to its shell and remain in the correct folder. It's just ...
This be .cd():
def cd(self, block=None):
previous = path(os.path.curdir).abspath()
That's based on Jason Orendoff's work at http://www.jorendorff.com/articles/python/path
More information about the Python-list