I tend to use only forward slashes for paths ('/') and python is happy with it also on windows.
In the description of os.path.join
it says that is the correct way if you want to go cross-platform. But when I use it I get mixed slashes:
import osa = 'c:/'b = 'myFirstDirectory/'c = 'mySecondDirectory'd = 'myThirdDirectory'e = 'myExecutable.exe'print os.path.join(a, b, c, d, e)# Result:c:/myFirstDirectory/mySecondDirectory\myThirdDirectory\myExecutable.exe
Is this correct? Should I check and correct it afterward or there is a better way?
Thanks
EDIT:I also get mixed slashes when asking for paths
import sysfor item in sys.path: print item# Result:C:\Program Files\Autodesk\Maya2013.5\binC:\Program Files\Autodesk\Maya2013.5\mentalray\scripts\AETemplatesC:\Program Files\Autodesk\Maya2013.5\PythonC:\Program Files\Autodesk\Maya2013.5\Python\lib\site-packagesC:\Program Files\Autodesk\Maya2013.5\bin\python26.zip\lib-tkC:/Users/nookie/Documents/maya/2013.5-x64/prefs/scriptsC:/Users/nookie/Documents/maya/2013.5-x64/scriptsC:/Users/nookie/Documents/maya/scriptsC:\Program Files\Nuke7.0v4\lib\site-packagesC:\Program Files\Nuke7.0v4/plugins/modules