r/PythonLearning • • Sep 27 '26

read and write csv file

just learned about functions so tried it out with csv editing

114 Upvotes

6 comments sorted by

View all comments

4

u/silvertank00 Sep 27 '26

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 Sep 27 '26

Ok, thank you!