Write a list of the contents of the current directory to a csv file in Python.