def combine(*paths):
#wisely determine which seperators to use... / or \
sep = ""
for path in paths:
iBS = path.find("/")
iSL = path.find("\\")
if iSL <> -1 or iBS <> -1:
if iBS <> -1:
sep = "/"
break;
if iSL <> -1:
sep = "\\"
break;
result = ""
lastI = len(paths)-1
for i in range(0, len(paths)):
path = paths[i]
if i == lastI:
result += path
else:
if path[len(path) -1 ] == sep:
result += path
else:
result += path + sep
return result