Skip to content

Commit 791332a

Browse files
fix: add missing line breaks for better readability in csv-module documentation
1 parent d80c4a4 commit 791332a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/modules/csv-module.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ with open(file_path, 'r', newline='') as csvfile:
4444
This function returns a reader object which can be easily iterated over to obtain each row. Each column in the corresponding rows can be accessed by the index, without the need to use the built-in function [`split()`](https://www.pythoncheatsheet.org/cheatsheet/manipulating-strings#split).
4545

4646
## csv.writer()
47+
4748
This function receives the file to be written as a csv file, similar to the reader function, it should be invoked as this:
4849

4950
```python
@@ -59,6 +60,7 @@ with open(file_path, 'w', newline='') as csvfile:
5960

6061
The "do something" block could be replaced with the use of the following functions:
6162
### writer.writerow()
63+
6264
Writes a single row to the CSV file.
6365

6466
```python
@@ -67,6 +69,7 @@ writer.writerow(['Alice', 30, 'London'])
6769
```
6870

6971
### writer.writerows()
72+
7073
Writes multiple rows at once.
7174

7275
```python
@@ -122,6 +125,7 @@ with open('people_dict.csv', 'w', newline='') as csvfile:
122125
## Additional params to csv.reader() and csv.writer()
123126

124127
### delimiter
128+
125129
Should be the character used to separate the fields. As the file type says, the default is the comma ','. Depending on the locale, Excel might generate csv files with the semicolon as a delimiter.
126130

127131
```python
@@ -134,9 +138,11 @@ with open('data_semicolon.csv', newline='') as csvfile:
134138
```
135139

136140
### lineterminator
141+
137142
Character or sequence of characters to end a line. Most common is "\r\n" but it could be "\n".
138143

139144
### quotechar
145+
140146
Character used to quote fields containing special characters (default is `"`).
141147

142148
```python

0 commit comments

Comments
 (0)