March 2003
Intermediate to advanced
656 pages
39h 30m
English
join
join(path,*paths)
Returns a string that joins the argument strings with the appropriate
path separator for the current platform. For example, on Unix,
exactly one slash character / separates adjacent
path components. If any argument is an absolute path,
join ignores all previous components. For example:
print os.path.join('a/b', 'c/d','e/f')
# on Unix prints: a/b/c/d/e/f
print os.path.join('a/b', '/c/d', 'e/f')
# on Unix prints: /c/d/e/fThe second call to os.path.join ignores its first
argument 'a/b', since its second argument
'/c/d' is an absolute path.