Last active
June 27, 2016 15:42
-
-
Save lanfon72/1526b303e02e448bccbf5efb701f7ec2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import pickle | |
| files = ['a.pickle', 'b.pickle', ...] | |
| csv.register_dialect('mycsv', 'excel', delimiter=',') | |
| for fil in files: | |
| csv_name = "%s.csv" % fil.split('.')[0] | |
| pf = open(fil, 'rb') | |
| cf = open(csv_name, 'wb') | |
| csvwriter = csv.writer(cf, dialect='mycsv') | |
| csvwriter.writerows(pickle.load(pf)) | |
| pf.close() | |
| cf.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment