Created
February 4, 2017 21:10
-
-
Save serhii73/854a8ca496acecb8ba91d290887eb8a7 to your computer and use it in GitHub Desktop.
Save the file with the directory creation
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
| filename = datetime.now().strftime("Output/%Y/%m/%d/%H/%M/%S/data") + '.csv' | |
| os.makedirs(os.path.dirname(filename), exist_ok=True) | |
| with open(filename, "w") as csvfile: | |
| writer = csv.writer(csvfile) | |
| writer.writerow(('a', 'b', 'c', 'd', 'e')) | |
| for row in zip(a, b, c, d, e): | |
| writer.writerow(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment