def prefixurl(base=''):
    url = web.ctx.path.lstrip('/')
    for i in xrange(url.count('/')): 
        base += '../'
    if not base: 
        base = './'
    return base
Sorry, this function is really difficult to explain.
dataset/ETHPy150Open rouge8/20questions/web/http.py/prefixurl