csvresults.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:prophet 作者: MKLab-ITI 项目源码 文件源码
def parse(self, source):

        r = Result('SELECT')

        if isinstance(source.read(0), py3compat.bytestype):
            # if reading from source returns bytes do utf-8 decoding
            source = codecs.getreader('utf-8')(source)

        reader = csv.reader(source, delimiter=self.delim)
        r.vars = [Variable(x) for x in reader.next()]
        r.bindings = []

        for row in reader:
            r.bindings.append(self.parseRow(row, r.vars))

        return r
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号