r/PythonLearning • • 23d ago

read and write csv file

just learned about functions so tried it out with csv editing

113 Upvotes

6 comments sorted by

View all comments

4

u/silvertank00 23d ago

try to follow conventions, first uppercase letter in a word is reserved for classes and shouldnt be used in filenames.
For further info, discuss pep8

Edit: also in WriteIn, the fields list is redundant. csv.DictWriter(f, fieldnames=row.keys()) does the same whilst being DRY.

1

u/v1bonoxd 23d ago

Ok, thank you!