mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
25 lines
273 B
Markdown
25 lines
273 B
Markdown
---
|
|
icon: package
|
|
label: csv
|
|
---
|
|
|
|
### `csv.reader(csvfile: list[str]) -> list`
|
|
|
|
Parse a CSV file into a list of lists.
|
|
|
|
|
|
## Example
|
|
|
|
```python
|
|
import csv
|
|
|
|
data = """a,b,c
|
|
1,2,3
|
|
"""
|
|
|
|
print(csv.reader(data.splitlines()))
|
|
# [
|
|
# ['a', 'b', 'c'],
|
|
# ['1', '2', '3']
|
|
# ]
|
|
``` |