Last active
December 31, 2020 10:52
-
-
Save LouisdeBruijn/cb7de6ed434a41cf2a83211bdb819c7c 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
| data = [ | |
| ("Hi my name is Louis, and I write compound sentences, often delimited by a comma.", "26", "de Bruijn") | |
| ] | |
| with open("texts.csv", "w") as csv_out: | |
| for element in data: | |
| csv_out.write("{0}\n".format(",".join(element))) | |
| objects = [] | |
| with open("texts.csv", "r") as csv_in: | |
| for line in csv_in: | |
| line = line.rstrip().split(",") | |
| objects.append(line) | |
| print(objects) | |
| >>> [['Hi my name is Louis', ' and I write compound sentences', ' often delimited by a comma.', '26', 'de Bruijn']] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment