20240924
This commit is contained in:
1 parent
96f043313c
commit
3a9cb48f1e
5 files changed
+1697
-229
No files matched your search
+33
@@ -557,6 +557,39 @@
|
||||
"print(dict1)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"#### 生成导入数据库语句"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/镇海体测手工数据.xlsx')\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"dict1 = {}\n",
|
||||
"list1 = []\n",
|
||||
"for n in range(1, sheet.max_row+1):\n",
|
||||
" id = int(sheet.cell(n, 1).value)\n",
|
||||
" item = int(sheet.cell(n, 2).value)\n",
|
||||
" perf = int(sheet.cell(n, 3).value)\n",
|
||||
" s = f'(345321,{id},{item},{perf},\"2024-09-22\",\"2024-09-22 18:00:00\")'\n",
|
||||
" list1.append(s)\n",
|
||||
"ss = ','.join(list1)\n",
|
||||
"print(ss)\n",
|
||||
" "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
|
||||
Reference in new issue
Block a user