首页 > 编程知识 正文

python读取数据库数据,python读取csv文件

时间:2023-05-03 12:24:35 阅读:21515 作者:3842

#!/usr/bin/env python3# "-* -编码: utf-8-* ' ' create_author:蛙鳖鹳狸猴create _ time 33602019-03-19 PPP ' ' importcodecsclasstsv (object ) : ' ' '.ts vfff file ) : ' ' tsv init. paramfile :tsvfiletohandle.' ' self.file=file def _ _ repr _ (self ) 33330 unr 3360 ' '.ts vfile ' scolumndefinitionanddatacheck. return : list.lines data from [ file ] rowbyrowindictformat.' ' ' utf-8 ' ) ASF : line=f.readline (data=[ ] head=[ ] while line 3360 if line.is space ) 3360 line=f.readline contone tobecompatiblebetweenoshead=line.RS trip ('r n ' ).split ) ) () ) () () ) ) 65 t ' ) line=f.readline (breakwhileline 3360 if line.is space ) : line=f ws=zip ) head,body ) tsv_DIC={}for ) head_sub,body_sub(inlist(rows ) : tsv _ DIC [ head _ su b ]=return data if _ _ name _=' _ _ main _ ' : with codecs.open (' tsv '、' w '、' utf-8 ' ) ASF 3360 rows=tcontent

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。