How to walk up parent directories?
a.a.ovtchinnikov at gmail.com
Mon May 4 08:26:23 EDT 2009
On May 4, 5:04 am, Matthew Wilson <m... at tplus1.com> wrote:
> Is there already a tool in the standard library to let me walk up from a
> subdirectory to the top of my file system?
Never seen such a standard tool, yet it can be implemented in a way
aux = path.rsplit('/')
while aux != ['']:
yield reduce(lambda x,y:x+'/'+y,aux)
Maybe this is not the best way to ascend directories, but it seems to
More information about the Python-list