def join_path(a, *p):
 path = a
 for b in p:
  if (len(b) == 0):
   continue
  if b.startswith('/'):
   path += b[1:]
  elif ((path == '') or path.endswith('/')):
   path += b
  else:
   path += ('/' + b)
 return path

def join_path ( a , * p ) : path = a for b in p : if ( len ( b ) == 0 ) : continue if b . startswith ( '/' ) : path += b [ 1 : ] elif ( ( path == '' ) or path . endswith ( '/' ) ) : path += b else : path += ( '/' + b ) return path
join path tokens together similar to osp .