got it. thanks. :)
On Sat, Feb 20, 2010 at 11:19 PM, MRAB <pyt...@mrabarnett.plus.com> wrote: > Shashwat Anand wrote: > >> basically I infer that : dirname = path - basename, like for path = >> '//x', basename = x, hence dirname = '//' >> >> [snip] > Basically, os.path.dirname() should return the directory name, which > means dropping everything after the last slash, and also the last slash. > However, there's the special case where the name is in the root > directory, and you want to retain the slash(es). > > When building a path (os.path.join()) you want to join the parts with a > single slash between them, but there's the special case when a part is > the root directory, and you don't want to add a slash between them, eg > os.part.join('/x', 'y') should return '/x/y', but os.part.join('/', 'x') > should return '/x'. > > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list