How can I add a trailing slash (/ for *nix, \\ for win32) to a directory string, if the tailing slash is not already there? Thanks!
/
\\
os.path.join(path, '') will add the trailing slash if it's not already there.
os.path.join(path, '')
You can do os.path.join(path, '', '') or os.path.join(path_with_a_trailing_slash, '') and you will still only get one trailing slash.
os.path.join(path, '', '')
os.path.join(path_with_a_trailing_slash, '')