Neil Cerutti <ne...@norwich.edu> writes: > On 2011-07-29, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: >> Fine... So normpath it first... >> >>>>> os.path.normpath(r'C:/windows').split(os.sep) >> ['C:', 'windows']
That apparently doesn't distinguish between r'C:\windows' and r'C:windows'. On Windows the first is an absolute path, the second a relative path, and both contain a drive letter. > while tail != '': > retval.append(tail) > head, tail = os.path.split(head) > else: > if os.path.isabs(path): > retval.append(os.path.sep) > return list(reversed(retval)) Note that using 'else' after 'while' is superfluous if the loop doesn't contain a 'break' statement. -- http://mail.python.org/mailman/listinfo/python-list