id: 4a7935da76b44f89aa02383964a2e5ed
parent_id: 
item_type: 1
item_id: 4bb9899d5a5540bbbbe2bec810806e58
item_updated_time: 1764345564237
title_diff: "[{\"diffs\":[[1,\"Python解析excel文件并存入sqlite数据库 - oYabea - 博客园\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":42}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>Python解析excel文件并存入sqlite数据库 - oYabea - 博客园</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"application-data:2525275\\\" content=\\\"6692893/s30/cb7a39ac-e649-49ee-9af3-0ee949a08029/app.yinxiang.com\\\"/>\\\r\\\n  <meta name=\\\"application-data:ANDROID_CLIP_TYPE\\\" content=\\\"article\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"8756\\\"></a>\\\r\\\n<h1>Python解析excel文件并存入sqlite数据库 - oYabea - 博客园</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;\\\"><div style=\\\"font-size: 16px\\\"><div><div style=\\\"font-family:Verdana, Arial, Helvetica, sans-serif;background-image:url(http://www.cnblogs.com/skins/CodingLife/images/body_bg.png);background-attachment:scroll;background-color:rgb(240, 238, 245);color:rgb(125, 139, 141);font-size:14px;line-height:25px;background-position:0px 0px;background-repeat:repeat no-repeat;\\\"><div><div><div style=\\\"background-image:none;overflow:visible;text-overflow:ellipsis;word-break:break-all;\\\"><div><div><div style=\\\"background-color:rgb(255, 255, 255);overflow:hidden;\\\"><div>\\\n\\t\\t<h1 style=\\\"margin:0px;padding:0px;font-size:28px;font-weight:400;margin-bottom:20px;line-height:1.8;color:rgb(51, 51, 51);\\\">\\\n\\t\\t\\t<a href=\\\"http://www.cnblogs.com/ybjourney/p/5523878.html\\\" style=\\\"margin:0px;padding:0px;color:rgb(51, 51, 51);text-decoration:none;\\\">Python解析excel文件并存入sqlite数据库</a>\\\n\\t\\t</h1>\\\n\\t\\t<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\\n\\t\\t<div style=\\\"margin:0px;padding:0px;\\\">\\\n\\t\\t\\t<div style=\\\"margin:0px;padding:0px;margin-bottom:20px;word-break:break-word;color:rgb(51, 51, 51);line-height:1.8;\\\"><p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">最近由于工作上的需求 需要使用Python解析excel文件并存入sqlite 就此做个总结 </span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">功能：</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">1.数据库设计 建立数据库</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">2.Python解析excel文件</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">3.Python读取文件名并解析</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">4.将解析的数据存储入库</span></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:18pt;\\\"><strong style=\\\"margin:0px;padding:0px;\\\"><span style=\\\"margin:0px;padding:0px;line-height:1.5;\\\">一 建立数据库</span></strong></span></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">根据需求建立数据库,建立了两个表，并保证了可以将数据存储到已有的数据库中，代码如下：</span></p>\\\n<div style=\\\"margin:5px 0px;padding:5px;background-color:rgb(245, 245, 245);border:1px solid rgb(204, 204, 204);overflow:auto;color:rgb(0, 0, 0);font-family:'Courier New';font-size:12px;\\\"><div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/1253b35dcc3745aca2bdb6c0ab0d40d7\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div>\\\n<pre style=\\\"margin:0px;padding:0px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;word-wrap:break-word;font-family:'Courier New';font-size:12px;\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">import</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> sqlite3\\\n\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">def</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> createDataBase():\\\ncn </span>= sqlite3.connect(<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">check.db</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n\\\ncn.execute(</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'''</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">CREATE TABLE IF NOT EXISTS TB_CHECK\\\n(ID integer PRIMARY KEY AUTOINCREMENT,\\\nNUMBER INTEGER,\\\nITEM TEXT,\\\nREFERENCE TEXT,\\\nSUMMARY TEXT,\\\nOBJECT TEXT,\\\nMETHOD TEXT,\\\nCONDITION TEXT,\\\nVALUE TEXT,\\\nRESULT TEXT,\\\nSCORE TEXT,\\\nREMARKS TEXT,\\\nPROVINCE TEXT,\\\nTIME TEXT);</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'''</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n\\\ncn.execute(</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'''</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">CREATE TABLE IF NOT EXISTS TB_SCORE\\\n(ID integer PRIMARY KEY AUTOINCREMENT,\\\nPROVINCE TEXT,\\\nTIME TEXT,\\\nFILETYPE TEXT,\\\nSCORE INTEGER);</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'''</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800080;\\\">__name__</span> == <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">__main__</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\ncreateDataBase()</span></pre>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/bb930155508d43f7b446a40e4cfa14cc\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div></div>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"> </p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:18pt;line-height:1.5;\\\">二 使用Python解析excel</span></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">Python中的xlrd模块用来解析excel。相关功能介绍如下：</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">1. 导入</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">import xlrd</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">2. 读取数据</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">data = xlrd.open_workbook('file.xls')</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">3. 功能</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">（1） 通过索引获取</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">table = data.sheet()[0]</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">table = data.sheet_by_index(0)</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">（2）通过名称获取</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">table = data.sheet_by_name(u'sheet1')</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">（3）获取整行和整列的值（数组)</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">table.row_values(i)</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">table.col_values(i)</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">（4）获取行数和列数</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">nrows = table.nrows</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">ncols = table.ncols</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">（5）循环行列表数据</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">for i in range(nrows):</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">    print table.row_values(i)</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">（6）单元格</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">cell_A1 = table.cell(0,0).value</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">（7）使用行列索引</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">cell_A1 = table.cell(0,0).value</span></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">练习代码：</span></p>\\\n<div style=\\\"margin:5px 0px;padding:5px;background-color:rgb(245, 245, 245);border:1px solid rgb(204, 204, 204);overflow:auto;color:rgb(0, 0, 0);font-family:'Courier New';font-size:12px;\\\"><div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/93090b4521b54546a83c8574c465880e\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div>\\\n<pre style=\\\"margin:0px;padding:0px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;word-wrap:break-word;font-family:'Courier New';font-size:12px;\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">import</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> xlrd\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">import</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> xlwt\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">from</span> datetime <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">import</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> date,datetime\\\n\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">def</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> read_excel():\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\"> 打开文件</span>\\\nworkbook = xlrd.open_workbook(r<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">file.xls</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\"> 获取所有sheet</span>\\\nsheet_name =<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> workbook.sheet_names()[0]\\\nsheet </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> workbook.sheet_by_name(sheet_name)\\\n\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">获取一行的内容</span>\\\n<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">for</span> i <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">in</span> range(6<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">,sheet.nrows):\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">for</span> j <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">in</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> range(0,sheet.ncols):\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">print</span> sheet.cell(i,j).value.encode(<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">utf-8</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800080;\\\">__name__</span> == <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">__main__</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\nread_excel()</span></pre>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/fde4daeb22cc441fb19530a3f6995398\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div></div>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"> </p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:18pt;line-height:1.5;\\\">三 Python读取文件名并解析</span></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">为了将各个文件的数据加以区分，需要将文件名中标志性字段入库，解析文件的代码如下：</span></p>\\\n<div style=\\\"margin:5px 0px;padding:5px;background-color:rgb(245, 245, 245);border:1px solid rgb(204, 204, 204);overflow:auto;color:rgb(0, 0, 0);font-family:'Courier New';font-size:12px;\\\"><div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/077f1fc1ad984ebcae37f9dbf857526d\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div>\\\n<pre style=\\\"margin:0px;padding:0px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;word-wrap:break-word;font-family:'Courier New';font-size:12px;\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">import</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> os\\\n\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">def</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> getFileList(dir,wildcard,recursion):\\\n    os.chdir(dir)\\\n\\\n    fileList </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> []\\\n    check_province </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> []\\\n    check_time </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> []\\\n    file_type </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> []\\\n\\\n    exts </span>= wildcard.split(<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n    files </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> os.listdir(dir)\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">for</span> name <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">in</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> files:\\\n        fullname</span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">os.path.join(dir,name)\\\n        </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span>(os.path.isdir(fullname) &amp;<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> recursion):\\\n            getFileList(fullname,wildcard,recursion)\\\n        </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">else</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\n            </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">for</span> ext <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">in</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> exts:\\\n                </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">(name.endswith(ext)):\\\n                    fileList.append(name)\\\n                    check_province.append(name.split(</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">-</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span>)[1<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">])\\\n                    check_time.append(name.split(</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">-</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)[0])\\\n                    file_type.append(name.split(</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">-</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span>)[2<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">])\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">return</span> fileList,check_time,check_province,file_type</pre>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/d96072d8378844159e594834da10046f\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div></div>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"> </p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;line-height:1.5;\\\">在接下来的使用中 会遇到编码问题 所以在使用这些字段时需要先转码，编写转码函数如下：</span></p>\\\n<div style=\\\"margin:5px 0px;padding:5px;background-color:rgb(245, 245, 245);border:1px solid rgb(204, 204, 204);overflow:auto;color:rgb(0, 0, 0);font-family:'Courier New';font-size:12px;\\\"><div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/7965d8c640634eaaa662bcaf87e81939\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\">#转码函数<br style=\\\"margin:0px;padding:0px;\\\"/>def changeCode(name):<br style=\\\"margin:0px;padding:0px;\\\"/>    　　name = name.decode('GBK')<br style=\\\"margin:0px;padding:0px;\\\"/>    　　name = name.encode('UTF-8')<br style=\\\"margin:0px;padding:0px;\\\"/>    　　return name</p>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/daa755e9156d458cb2403e5184cc265f\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div></div>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"> </p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:18pt;\\\">四  解析excel文件并将其存储到sqlite</span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">　　Python连接数据库 选取了Python自带的sqlite数据库 相对简单 在此不做太多介绍 如果大家对Python操作sqlite有疑惑的话 个人推荐菜鸟教程～</span></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">　　下面是解析excel文件并存入数据库,其中包含了判断单元格内容：</span></p>\\\n<div style=\\\"margin:5px 0px;padding:5px;background-color:rgb(245, 245, 245);border:1px solid rgb(204, 204, 204);overflow:auto;color:rgb(0, 0, 0);font-family:'Courier New';font-size:12px;\\\"><div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/b128b7c93c0f4f0c9528b26b599a3d4c\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div>\\\n<pre style=\\\"margin:0px;padding:0px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;word-wrap:break-word;font-family:'Courier New';font-size:12px;\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">def</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> readExcel(filename,cn,check_province,check_time,FileType):\\\n  </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">读取</span>\\\n  workbook =<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> xlrd.open_workbook(filename)\\\n  </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\"> 获取sheet</span>\\\n  sheet_name =<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> workbook.sheet_names()[0]\\\n  　　sheet </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> workbook.sheet_by_name(sheet_name)\\\n\\\n  check_Item </span>= <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">a</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span>\\\n\\\n  itemCount =<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> 0\\\n  score </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> 0\\\n\\\n  second </span>= sheet.cell(7,1).value.encode(<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">utf-8</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n\\\n  </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">for</span> i <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">in</span> range(7<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">,sheet.nrows):\\\n      </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span> sheet.cell(i,1).value.encode(<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">utf-8</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span>) ==<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> second:\\\n          check_Item </span>= sheet.cell(i,0).value.encode(<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">utf-8</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n          </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">continue</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">\\\n\\\n      temp </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> []\\\n      </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">for</span> j <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">in</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> range(0,sheet.ncols):\\\n          temp.append(sheet.cell(i,j).value.encode(</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">utf-8</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">))\\\n\\\n      answer </span>= sheet.cell(i,7).value.encode(<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">utf-8</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n\\\n</span>      <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span> answer == <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">yes</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">or</span> answer == <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">no</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\n          score </span>= score + 1\\\n\\\n      <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span> answer == <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">other</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\n          </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">print</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">!!!Failed to import'%s'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span> %<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> (filename)\\\n          </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">print</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">!!!Please Choose an Right Answer for '%s'--------</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span>%<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">(filename)\\\n          </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">break</span>\\\n      <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">else</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\n          cn.execute(</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">insert into TB_CHECK (ITEM,FIELD,TYPE,CONTENT,</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span>\\\n                     <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">ATTRIBUTE,CHECKPOINT,REMARKS,ANSWER,DESCRIPTION,</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span>\\\n                     <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">SUGGESTION,PROVINCE,TIME,STYLE) </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span>\\\n                     <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span>\\\n                     <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;&quot;</span>%(temp[0],temp[1],temp[2],temp[3],temp[4],temp[5],temp[6],temp[7],temp[8],temp[9<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">],check_province,check_time,check_Item))\\\n\\\n          itemCount </span>= itemCount + 1\\\n  <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span> itemCount !=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> 0:\\\n      score </span>= round(score * (100 / itemCount), 2<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n      cn.execute(</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">insert into TB_SCORE (PROVINCE,TIME,FILETYPE,SCORE) </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span>\\\n             <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">values('%s','%s','%s','%.2f')</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span>%<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">(check_province,check_time,FileType,score))\\\n      </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">print</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">Successful for'%s'--------</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span> %<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> (filename)\\\n  cn.commit()</span></pre>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/f9210c3c4b3f4fb48926c73b48def07e\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div></div>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"> </p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\">　　<br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">整合上述功能：</span></p>\\\n<div style=\\\"margin:5px 0px;padding:5px;background-color:rgb(245, 245, 245);border:1px solid rgb(204, 204, 204);overflow:auto;color:rgb(0, 0, 0);font-family:'Courier New';font-size:12px;\\\"><div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/75f055a7359944879a0100fecad7e844\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div>\\\n<pre style=\\\"margin:0px;padding:0px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;word-wrap:break-word;font-family:'Courier New';font-size:12px;\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">def</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> importData(path):\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\"> 数据库</span>\\\n<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">    createDataBase()\\\n    database </span>= sqlite3.connect(<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">check.db</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">文件类型</span>\\\n    wildcard = <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">.xls</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">\\\n\\\n    list </span>= getFileList(path,wildcard,1<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">)\\\n\\\n    nfiles </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> len(list[0])\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">文件名</span>\\\n    file =<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> list[0]\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">时间</span>\\\n    time = list[1<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">]\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">省份</span>\\\n    province = list[2<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">]\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\">#</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#008000;\\\"> #文件类型</span>\\\n    FileType = list[3<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">]\\\n\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">for</span> count <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">in</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> range(0,nfiles):\\\n        filename </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> file[count]\\\n        check_province </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> changeCode(province[count])\\\n        check_time </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> time[count]\\\n        File_type </span>=<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\"> changeCode(FileType[count])\\\n        readExcel(filename,database,check_province,check_time,File_type)\\\n\\\n</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800080;\\\">__name__</span> == <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">__main__</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">'</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\n    </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">if</span> len(sys.argv) != 2<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\n        </span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">print</span> <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">Wrong Parameters</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#800000;\\\">&quot;</span>\\\n    <span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#0000ff;\\\">else</span><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">:\\\n        path </span>= sys.argv[1<span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;color:#000000;\\\">]\\\n        importData(path)</span></pre>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:5px;background-color:rgb(245, 245, 245);\\\"><span style=\\\"margin:0px;padding:0px;font-family:'Courier New';font-size:12px;line-height:1.5;padding-right:5px;\\\"><a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;background-color:rgb(245, 245, 245);border:none;\\\" title=\\\"复制代码\\\"><img src=\\\":/c599943e2a544e16afd76acddd60a5cd\\\" type=\\\"image/gif\\\" data-filename=\\\"69c5a8ac3fa60e0848d784a6dd461da6.gif\\\"/></a></span></div></div>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"> </p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">这就是解析excel文件并存入sqlite的主要代码 </span><br style=\\\"margin:0px;padding:0px;\\\"/><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\">完整代码见：https://github.com/Ben0825/Python</span></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\"> </span></p>\\\n<p style=\\\"margin:10px auto;padding:0px;text-indent:0px;\\\"><span style=\\\"margin:0px;padding:0px;font-size:14pt;\\\"> </span></p></div>\\\n<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:20px;\\\">\\\n<div style=\\\"margin:0px;padding:0px;margin-bottom:10px;\\\">分类: <a href=\\\"http://www.cnblogs.com/ybjourney/category/703913.html\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;margin-left:10px;\\\">python</a></div>\\\n<div style=\\\"margin:0px;padding:0px;margin-top:0px;font-size:14px;color:rgb(126, 140, 141);font-weight:bold;\\\"></div>\\\n<div style=\\\"margin:0px;padding:0px;\\\"><div style=\\\"margin:0px;padding:10px 0px;margin-bottom:10px;margin-top:10px;border:1px dashed silver;font-size:12px;width:350px;text-align:center;\\\">\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 8px;color:rgb(255, 255, 255);text-decoration:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNo8zjsOxCAMBFB/KEAUFFR0Cbng3nQPw68ArZdAlOZppPFIBhH5EAB8b+Tlt9MYQ6i1BuqFaq1CKSVcxZ2Acs6406KUgpt5/LCKuVgz5BDCSb13ZO99ZOdcZGvt4mJjzMVKqcha68iIePB86GAiOv8CDADlIUQBs7MD3wAAAABJRU5ErkJggg%3D%3D);display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;-webkit-box-shadow:rgba(0, 0, 0, 0.498039) 0px 1px 3px;text-shadow:rgba(0, 0, 0, 0.247059) 0px -1px 1px;vertical-align:middle;background-repeat:repeat no-repeat;border:none;background-color:rgb(45, 174, 191);\\\">好文要顶</a>\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 8px;color:rgb(255, 255, 255);text-decoration:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNo8zjsOxCAMBFB/KEAUFFR0Cbng3nQPw68ArZdAlOZppPFIBhH5EAB8b+Tlt9MYQ6i1BuqFaq1CKSVcxZ2Acs6406KUgpt5/LCKuVgz5BDCSb13ZO99ZOdcZGvt4mJjzMVKqcha68iIePB86GAiOv8CDADlIUQBs7MD3wAAAABJRU5ErkJggg%3D%3D);display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;-webkit-box-shadow:rgba(0, 0, 0, 0.498039) 0px 1px 3px;text-shadow:rgba(0, 0, 0, 0.247059) 0px -1px 1px;vertical-align:middle;background-repeat:repeat no-repeat;border:none;background-color:rgb(227, 49, 0);\\\">关注我</a>\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 8px;color:rgb(255, 255, 255);text-decoration:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNo8zjsOxCAMBFB/KEAUFFR0Cbng3nQPw68ArZdAlOZppPFIBhH5EAB8b+Tlt9MYQ6i1BuqFaq1CKSVcxZ2Acs6406KUgpt5/LCKuVgz5BDCSb13ZO99ZOdcZGvt4mJjzMVKqcha68iIePB86GAiOv8CDADlIUQBs7MD3wAAAABJRU5ErkJggg%3D%3D);display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;-webkit-box-shadow:rgba(0, 0, 0, 0.498039) 0px 1px 3px;text-shadow:rgba(0, 0, 0, 0.247059) 0px -1px 1px;vertical-align:middle;background-repeat:repeat no-repeat;border:none;background-color:rgb(255, 181, 21);\\\">收藏该文</a>\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 2px;color:rgb(255, 255, 255);text-decoration:none;background-image:none;display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;-webkit-box-shadow:none;text-shadow:none;vertical-align:middle;background-repeat:repeat no-repeat;border:none;\\\" title=\\\"分享至新浪微博\\\"><img src=\\\":/afbb7869feb14d068ff30872781621be\\\" type=\\\"image/png\\\" data-filename=\\\"d5aea86bdec32a66be1446dacc4efd84.png\\\"/></a>\\\n<a href=\\\"#\\\" style=\\\"margin:0px;padding:3px 2px;color:rgb(255, 255, 255);text-decoration:none;background-image:none;display:inline-block;font-weight:bold;cursor:pointer;margin-right:10px;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;-webkit-box-shadow:none;text-shadow:none;vertical-align:middle;background-repeat:repeat no-repeat;border:none;\\\" title=\\\"分享至微信\\\"><img src=\\\":/b9f24b03139c48738d2633e5149626d2\\\" type=\\\"image/png\\\" data-filename=\\\"0d5b76b4ae98cefd7c2d4300c27b1c69.png\\\"/></a>\\\n</div>\\\n<div style=\\\"margin:0px;padding:0px;float:left;width:280px;margin-top:0px;margin-bottom:10px;color:rgb(0, 0, 0);margin-left:0px;font-size:12px;\\\">\\\n<div style=\\\"margin:0px;padding:0px;float:left;line-height:18px;\\\">\\\n<a href=\\\"http://home.cnblogs.com/u/ybjourney/\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;\\\" target=\\\"_blank\\\"><img src=\\\":/8fb2d3822b9741bfb19e19127b2dec5b\\\" type=\\\"image/png\\\" data-filename=\\\"d329a2daba350dcac8fa4ebc680bfd69.png\\\"/></a>\\\n<div style=\\\"margin:0px;padding:0px;float:left;line-height:18px;\\\">\\\n<a href=\\\"http://home.cnblogs.com/u/ybjourney/\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;\\\">oYabea</a><br style=\\\"margin:0px;padding:0px;\\\"/>\\\n<a href=\\\"http://home.cnblogs.com/u/ybjourney/followees\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;\\\">关注 - 4</a><br style=\\\"margin:0px;padding:0px;\\\"/>\\\n<a href=\\\"http://home.cnblogs.com/u/ybjourney/followers\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;\\\">粉丝 - 44</a>\\\n</div>\\\n</div>\\\n<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\\n<div style=\\\"margin:0px;padding:0px;\\\"></div>\\\n<div style=\\\"margin:0px;padding:0px;\\\">\\\n    <a href=\\\"#\\\" style=\\\"margin:0px;padding:0px;color:rgb(0, 0, 0);text-decoration:none;\\\">+加关注</a>\\\n</div>\\\n</div>\\\n<div style=\\\"margin:0px;padding:0px;float:right;margin-bottom:10px;margin-right:30px;font-size:12px;width:125px;text-align:center;margin-top:10px;\\\">\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\n    <div style=\\\"margin:0px;padding:0px;float:left;width:46px;height:52px;background-image:url(http://static.cnblogs.com/images/upup.gif);text-align:center;cursor:pointer;margin-top:2px;padding-top:5px;background-repeat:no-repeat no-repeat;\\\">\\\n        <span style=\\\"margin:0px;padding:0px;font-size:14px;color:rgb(7, 93, 179);font-family:Verdana;line-height:1.5em;\\\">0</span>\\\n    </div>\\\n\\t<div style=\\\"margin:0px;padding:0px;float:right;margin-left:20px;width:46px;height:52px;background-image:url(http://static.cnblogs.com/images/downdown.gif);text-align:center;cursor:pointer;margin-top:2px;padding-top:5px;background-repeat:no-repeat no-repeat;\\\"> \\\n\\t\\t<span style=\\\"margin:0px;padding:0px;font-size:14px;color:rgb(7, 93, 179);font-family:Verdana;line-height:1.5em;\\\">0</span>\\\n\\t</div>\\\n\\t<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\t\\\n\\t<div style=\\\"margin:0px;padding:0px;margin-top:5px;margin-left:0px;font-size:12px;color:gray;\\\">\\\n    (请您对文章做出评价)\\\n    </div>\\t\\\n</div>\\\n</div>\\\n<div style=\\\"margin:0px;padding:0px;clear:both;\\\"></div>\\\n<div style=\\\"margin:10px 0px;padding:0px;line-height:200%;font-size:14px;\\\"><a href=\\\"http://www.cnblogs.com/ybjourney/p/5304501.html\\\" style=\\\"margin:0px;padding:0px;color:rgb(51, 51, 51);text-decoration:none;\\\">« </a> 上一篇：<a href=\\\"http://www.cnblogs.com/ybjourney/p/5304501.html\\\" style=\\\"margin:0px;padding:0px;color:rgb(51, 51, 51);text-decoration:none;\\\" title=\\\"发布于2016-03-22 01:03\\\">python简单爬虫</a><br style=\\\"margin:0px;padding:0px;\\\"/></div>\\\n</div>\\\n\\\n\\\n\\t\\t</div>\\\n\\t\\t<div style=\\\"margin:10px 0px;padding:0px;clear:both;color:rgb(119, 119, 119);float:none;text-align:left;line-height:200%;font-size:14px;\\\">posted @ <span style=\\\"margin:0px;padding:0px;\\\">2016-05-24 16:31</span> <a href=\\\"http://www.cnblogs.com/ybjourney/\\\" style=\\\"margin:0px;padding:0px;color:rgb(153, 153, 153);text-decoration:none;\\\">oYabea</a> 阅读(<span style=\\\"margin:0px;padding:0px;\\\">48</span>) 评论(<span style=\\\"margin:0px;padding:0px;\\\">...</span>)  <a href=\\\"http://i.cnblogs.com/EditPosts.aspx?postid=5523878\\\" rel=\\\"nofollow\\\" style=\\\"margin:0px;padding:0px;color:rgb(153, 153, 153);text-decoration:none;\\\">编辑</a> <a href=\\\"http://www.cnblogs.com/ybjourney/p/5523878.html?utm_source=tuicool&amp;utm_medium=referral#\\\" style=\\\"margin:0px;padding:0px;color:rgb(153, 153, 153);text-decoration:none;\\\">收藏</a></div>\\\n\\t</div></div></div></div></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":57362}]"
metadata_diff: {"new":{"id":"4bb9899d5a5540bbbbe2bec810806e58","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348823563,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:03:59.780Z
created_time: 2025-11-28T21:03:59.780Z
type_: 13