How can I add a trailing slash (/ for *nix, \\ for win32) to a directory string, if the tailing slash is not already there? Thanks!
/
\\
Since you want to connect a directory and a filename, use
os.path.join(directory, filename)
If you want to get rid of .\..\..\blah\ paths, use
.\..\..\blah\
os.path.join(os.path.normpath(directory), filename)