Update save_database_info.py
Browse files- save_database_info.py +6 -2
save_database_info.py
CHANGED
|
@@ -20,7 +20,9 @@ import csv
|
|
| 20 |
|
| 21 |
def save_database_info(filepath, database_name, date):
|
| 22 |
# 读取CSV文件
|
| 23 |
-
with open(f'./database_name.csv', 'r', encoding='utf-8') as file:
|
|
|
|
|
|
|
| 24 |
# 创建CSV读取器
|
| 25 |
reader = csv.reader(file)
|
| 26 |
|
|
@@ -35,7 +37,9 @@ def save_database_info(filepath, database_name, date):
|
|
| 35 |
rows.append(new_row)
|
| 36 |
|
| 37 |
# 写入CSV文件
|
| 38 |
-
with open('./database_name.csv', 'w', newline='', encoding='utf-8') as file:
|
|
|
|
|
|
|
| 39 |
# 创建CSV写入器
|
| 40 |
writer = csv.writer(file)
|
| 41 |
# 写入所有行
|
|
|
|
| 20 |
|
| 21 |
def save_database_info(filepath, database_name, date):
|
| 22 |
# 读取CSV文件
|
| 23 |
+
# with open(f'./database_name.csv', 'r', encoding='utf-8') as file:
|
| 24 |
+
with open(filepath, 'r', encoding='utf-8') as file:
|
| 25 |
+
|
| 26 |
# 创建CSV读取器
|
| 27 |
reader = csv.reader(file)
|
| 28 |
|
|
|
|
| 37 |
rows.append(new_row)
|
| 38 |
|
| 39 |
# 写入CSV文件
|
| 40 |
+
# with open('./database_name.csv', 'w', newline='', encoding='utf-8') as file:
|
| 41 |
+
with open(filepath, 'w', newline='', encoding='utf-8') as file:
|
| 42 |
+
|
| 43 |
# 创建CSV写入器
|
| 44 |
writer = csv.writer(file)
|
| 45 |
# 写入所有行
|