BTW, to make the separator replacement code portable, use os.sep (http://docs.python.org/2/library/os.html#os.sep) which will be the right character on each OS.