Python write list to file comma separated. Your out file should look like this: # file.