Autosave: 2024-04-28 14:30:05
This commit is contained in:
parent
2679f0e2c7
commit
e5f4971461
2 changed files with 9 additions and 1 deletions
BIN
.zk/notebook.db
BIN
.zk/notebook.db
Binary file not shown.
|
@ -76,7 +76,15 @@ Use standard Pythonic "read" syntax:
|
|||
|
||||
```py
|
||||
with open('./new_csv_file.csv', mode="w") as csv_file:
|
||||
write = csv.writer(csv_file)
|
||||
writer = csv.writer(csv_file)
|
||||
```
|
||||
|
||||
The above will create the file as well, it doesn't need to be pre-existing.
|
||||
|
||||
This creates the writer object. To actually write a row:
|
||||
|
||||
```py
|
||||
some_list = ['thomas', 'engineer']
|
||||
for element in some_list:
|
||||
writer.writerow(element)
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue