Constructing Pathnames
import os
os.path.join("c:\\music\\ap\\", "mahadeva.mp3") #The join function of os.path constructs a pathname out of one or more partial pathnames. In this case, it simply concatenates strings. (Note that dealing with pathnames on Windows is annoying because the backslash character must be escaped
os.path.join("c:\\music\\ap", "mahadeva.mp3") # join will add an extra backslash to the pathname before joining it to the filename If Necessary
os.path.expanduser("~") # expanduser will expand a pathname that uses ~ to represent the current user's home directory.
os.path.join(os.path.expanduser("~"), "Python") # Combining these techniques, you can easily construct pathnames for directories and files under the user's home directory.