Finding the relative path of a file from a dir

2006-01-20 Thread Suresh Jeevanandam
Hi, a = '/home/suresh/doc/html/a1/' b = '/home/suresh/doc/' I am looking for a standard function which will return the location of b relative to a i.e. '../..' I have gone through the os and os.path modules, but could not find any function of use. Should I write my own?

Re: Finding the relative path of a file from a dir

2006-01-20 Thread utabintarbo
http://groups.google.com/group/comp.lang.python/browse_thread/thread/390d8d3e3ac8ef44/d8c74f96468c6a36?q=relative+pathrnum=1#d8c74f96468c6a36 -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the relative path of a file from a dir

2006-01-20 Thread Peter Hansen
Suresh Jeevanandam wrote: a = '/home/suresh/doc/html/a1/' b = '/home/suresh/doc/' I am looking for a standard function which will return the location of b relative to a i.e. '../..' I have gone through the os and os.path modules, but could not find any function of

Re: Finding the relative path of a file from a dir

2006-01-20 Thread Kent Johnson
Suresh Jeevanandam wrote: Hi, a = '/home/suresh/doc/html/a1/' b = '/home/suresh/doc/' I am looking for a standard function which will return the location of b relative to a i.e. '../..' Jason Orendorff's path module has a method for this (relpathto()).

Re: Finding the relative path of a file from a dir

2006-01-20 Thread Fuzzyman
pathutils has a function to do this (actually extracted from the path module). http://www.voidspace.org.uk/python/pathutils.html All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list