import csv
with open('csv.csv','r') as file:
reader = csv.reader(file)
比如这个 reader ,我要怎么才能查到它里面究竟是啥结构?
import csv
with open('csv.csv','r') as file:
reader = csv.reader(file)
比如这个 reader ,我要怎么才能查到它里面究竟是啥结构?
|
1
print 显示
```<_csv.reader object at 0x00000210A7EFDEA0>``` help 显示: ```class reader(builtins.object) | CSV reader | | Reader objects are responsible for reading and parsing tabular data | in CSV format. | | Methods defined here: | | __iter__(self, /) | Implement iter(self). | | __next__(self, /) | Implement next(self). | | ---------------------------------------------------------------------- | Data descriptors defined here: | | dialect | | line_num``` ``` |
|
zk8802Aug 24, 2022 via iPhone
2
print(dir(reader))
|
|
binge921Aug 24, 2022
3
对象的内部结构 一般需要 ”脱掉“
|
|
kaigerAug 24, 2022
4
|
|
killva4624Aug 24, 2022
5
看源码是最好的,去翻翻 csv. reader() 这个函数返回的对象。
|
|
treizeorAug 24, 2022
6
解剖?
|
|
yucongoAug 25, 2022 via Android
7
其实你要查的是 csv.reader:
help(csv.reader) |
|
julyclydeAug 25, 2022
8
dir
|