I have a list of directory name and want to add a fixed path before it. I am aware that, it can be done in two ways, 1) Using for loop and 2) using map() function.
I was able to do using for loop:
dirNames = ['dir1', 'dir2']
dirsFullPath = [os.path.join('C:\\', dir) for dir in dirNames]
But with map how to pass two parameters i.e. 'C:\' and directory name for every directory name in list.
dirsFullPath = map(os.path.join, dirNames) # so where to put 'C:\\' in this line.