File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
examples/miniapps/movie-lister Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 18
18
19
19
20
20
def create_csv (movies_data , path ):
21
- with open (path , "w" ) as opened_file :
21
+ with open (path , "w" , newline = "" ) as opened_file :
22
22
writer = csv .writer (opened_file )
23
- for row in movies_data :
24
- writer .writerow (row )
23
+ writer .writerows (movies_data )
25
24
26
25
27
26
def create_sqlite (movies_data , path ):
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def __init__(
29
29
super ().__init__ (movie_factory )
30
30
31
31
def find_all (self ) -> List [Movie ]:
32
- with open (self ._csv_file_path ) as csv_file :
32
+ with open (self ._csv_file_path , newline = "" ) as csv_file :
33
33
csv_reader = csv .reader (csv_file , delimiter = self ._delimiter )
34
34
return [self ._movie_factory (* row ) for row in csv_reader ]
35
35
You can’t perform that action at this time.
0 commit comments