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
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()).
http://www.jorendorff.c
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
http://groups.google.com/group/comp.lang.python/browse_thread/thread/390d8d3e3ac8ef44/d8c74f96468c6a36?q=relative+path&rnum=1#d8c74f96468c6a36
--
http://mail.python.org/mailman/listinfo/python-list
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?