slash because of the windows drive syntaxuse the preceding str join method instead if the difference matters the normpath call comes in handy if your paths become jumble of unix and windows separatorsmixed ' :\\temp\\public/files/index htmlos path normpath(mixed' :\\temp\\public\\files\\index htmlprint(os path normpath( ' :\temp\\sub\file ext') :\temp\sub\file ext this module also has an abspath call that portably returns the full directory pathname of fileit accounts for adding the current directory as path prefixparent syntaxand moreos chdir( ' :\users'os getcwd(' :\\usersos path abspath(''' :\\usersos path abspath('temp'' :\\users\\tempos path abspath( 'pp \dev'' :\\users\\pp \\devempty string means the cwd expand to full pathname in cwd partial paths relative to cwd os path abspath('' :\\usersos path abspath('' :\\os path abspath( \examples'' :\\examplesrelative path syntax expanded os path abspath( ' :\pp thed\'' :\\pp thed\\os path abspath( ' :\temp\spam txt'' :\\temp\\spam txtabsolute paths unchanged because filenames are relative to the current working directory when they aren' fully specified pathsthe os path abspath function helps if you want to show users what directory is truly being used to store file on windowsfor examplewhen gui-based programs are launched by clicking on file explorer icons and desktop shortcutsthe execution directory of the program is the clicked file' home directorybut that is not always obvious to the person doing the clickingprinting file' abspath can help running shell commands from scripts the os module is also the place where we run shell commands from within python scripts this concept is intertwined with otherssuch as streamswhich we won' cover fully until the next but since this is key concept employed throughout this system tools