diff --git a/交互/Agent/80.py b/基本结构/松耦合/Agent/80.py similarity index 100% rename from 交互/Agent/80.py rename to 基本结构/松耦合/Agent/80.py diff --git a/基本结构/041 插件/__pycache__/tf-20.cpython-38.pyc b/基本结构/松耦合/插件/__pycache__/tf-20.cpython-38.pyc similarity index 100% rename from 基本结构/041 插件/__pycache__/tf-20.cpython-38.pyc rename to 基本结构/松耦合/插件/__pycache__/tf-20.cpython-38.pyc diff --git a/基本结构/041 插件/config.ini b/基本结构/松耦合/插件/config.ini similarity index 100% rename from 基本结构/041 插件/config.ini rename to 基本结构/松耦合/插件/config.ini diff --git a/基本结构/041 插件/plugins-src/compile.sh b/基本结构/松耦合/插件/plugins-src/compile.sh similarity index 100% rename from 基本结构/041 插件/plugins-src/compile.sh rename to 基本结构/松耦合/插件/plugins-src/compile.sh diff --git a/基本结构/041 插件/plugins-src/frequencies1.py b/基本结构/松耦合/插件/plugins-src/frequencies1.py similarity index 100% rename from 基本结构/041 插件/plugins-src/frequencies1.py rename to 基本结构/松耦合/插件/plugins-src/frequencies1.py diff --git a/基本结构/041 插件/plugins-src/frequencies2.py b/基本结构/松耦合/插件/plugins-src/frequencies2.py similarity index 100% rename from 基本结构/041 插件/plugins-src/frequencies2.py rename to 基本结构/松耦合/插件/plugins-src/frequencies2.py diff --git a/基本结构/041 插件/plugins-src/words1.py b/基本结构/松耦合/插件/plugins-src/words1.py similarity index 100% rename from 基本结构/041 插件/plugins-src/words1.py rename to 基本结构/松耦合/插件/plugins-src/words1.py diff --git a/基本结构/041 插件/plugins-src/words2.py b/基本结构/松耦合/插件/plugins-src/words2.py similarity index 100% rename from 基本结构/041 插件/plugins-src/words2.py rename to 基本结构/松耦合/插件/plugins-src/words2.py diff --git a/基本结构/041 插件/plugins/frequencies1.pyc b/基本结构/松耦合/插件/plugins/frequencies1.pyc similarity index 100% rename from 基本结构/041 插件/plugins/frequencies1.pyc rename to 基本结构/松耦合/插件/plugins/frequencies1.pyc diff --git a/基本结构/041 插件/plugins/frequencies2.cpython-38.pyc b/基本结构/松耦合/插件/plugins/frequencies2.cpython-38.pyc similarity index 100% rename from 基本结构/041 插件/plugins/frequencies2.cpython-38.pyc rename to 基本结构/松耦合/插件/plugins/frequencies2.cpython-38.pyc diff --git a/基本结构/041 插件/plugins/words1.pyc b/基本结构/松耦合/插件/plugins/words1.pyc similarity index 100% rename from 基本结构/041 插件/plugins/words1.pyc rename to 基本结构/松耦合/插件/plugins/words1.pyc diff --git a/基本结构/041 插件/plugins/words2.cpython-38.pyc b/基本结构/松耦合/插件/plugins/words2.cpython-38.pyc similarity index 100% rename from 基本结构/041 插件/plugins/words2.cpython-38.pyc rename to 基本结构/松耦合/插件/plugins/words2.cpython-38.pyc diff --git a/基本结构/041 插件/tf-20.py b/基本结构/松耦合/插件/tf-20.py similarity index 100% rename from 基本结构/041 插件/tf-20.py rename to 基本结构/松耦合/插件/tf-20.py diff --git a/计算设备/共享内存数据空间/30A.py b/计算设备/共享内存数据空间/30A.py index 34a90f5..8c53d46 100644 --- a/计算设备/共享内存数据空间/30A.py +++ b/计算设备/共享内存数据空间/30A.py @@ -1,5 +1,4 @@ -import threading -import queue +import threading, queue from cppy.cp_util import * # 处理单词 diff --git a/计算设备/共享内存数据空间/30B.py b/计算设备/共享内存数据空间/30B.py index 547a448..b927d9e 100644 --- a/计算设备/共享内存数据空间/30B.py +++ b/计算设备/共享内存数据空间/30B.py @@ -1,4 +1,4 @@ -import threading, queue, operator +import threading, queue from cppy.cp_util import * class WordFrequencyCounter: diff --git a/计算设备/数据库/tf-26.py b/计算设备/数据库/tf-26.py index 8288778..6ef18e4 100644 --- a/计算设备/数据库/tf-26.py +++ b/计算设备/数据库/tf-26.py @@ -49,9 +49,8 @@ def load_file_into_database(path_to_file, connection): # 建数据库,处理数据入库 ####################################################### -# 获取当前文件所在的目录 -current_dir = os.path.dirname(os.path.abspath(__file__)) # 构造数据库文件的完整路径 +current_dir = os.path.dirname(os.path.abspath(__file__)) db_file_path = os.path.join(current_dir, db_filename) if os.path.exists(db_file_path): diff --git a/语言特性/异步/82.py b/语言特性/异步/82.py index 5a47fbc..45c5c71 100644 --- a/语言特性/异步/82.py +++ b/语言特性/异步/82.py @@ -3,6 +3,9 @@ import aiofiles from collections import Counter from cppy.cp_util import * +# +# 协程 +# async def read_file(file_path): async with aiofiles.open(file_path, 'r', encoding='utf-8') as file: content = await file.read()