Upload 2 files
Browse files- database_name.csv +6 -0
- save_database_info.py +2 -2
database_name.csv
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name,date
|
2 |
+
joeshi,2023年9月
|
3 |
+
joeshi,2023年9月
|
4 |
+
Web App开发需求说明 20230512.pdf,2023-09-24 20:59
|
5 |
+
Sparks_of_AGI.pdf,2023-09-24 21:07
|
6 |
+
AI与ChatGPT讲座大纲 20230615.pdf,2023-09-24 21:11
|
save_database_info.py
CHANGED
@@ -20,7 +20,7 @@ import csv
|
|
20 |
|
21 |
def save_database_info(filepath, database_name, date):
|
22 |
# 读取CSV文件
|
23 |
-
with open('
|
24 |
# 创建CSV读取器
|
25 |
reader = csv.reader(file)
|
26 |
|
@@ -35,7 +35,7 @@ def save_database_info(filepath, database_name, date):
|
|
35 |
rows.append(new_row)
|
36 |
|
37 |
# 写入CSV文件
|
38 |
-
with open('
|
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 |
# 创建CSV读取器
|
25 |
reader = csv.reader(file)
|
26 |
|
|
|
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 |
# 写入所有行
|