import os path = "C: empmyFolderexample" newPath = path.replace(os.sep, '/') print newPath Output:<< C:/temp/myFolder/example/ >>