From 2518a5cd85d0084d10e0df1938ade52d5f9795fd Mon Sep 17 00:00:00 2001 From: zj3D Date: Sun, 17 Mar 2024 10:44:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {交互 => 基本结构/松耦合}/Agent/80.py | 0 .../插件}/__pycache__/tf-20.cpython-38.pyc | Bin .../{041 插件 => 松耦合/插件}/config.ini | 0 .../插件}/plugins-src/compile.sh | 0 .../插件}/plugins-src/frequencies1.py | 0 .../插件}/plugins-src/frequencies2.py | 0 .../插件}/plugins-src/words1.py | 0 .../插件}/plugins-src/words2.py | 0 .../插件}/plugins/frequencies1.pyc | Bin .../插件}/plugins/frequencies2.cpython-38.pyc | Bin .../插件}/plugins/words1.pyc | Bin .../插件}/plugins/words2.cpython-38.pyc | Bin .../{041 插件 => 松耦合/插件}/tf-20.py | 0 计算设备/共享内存数据空间/30A.py | 3 +-- 计算设备/共享内存数据空间/30B.py | 2 +- 计算设备/数据库/tf-26.py | 3 +-- 语言特性/异步/82.py | 3 +++ 17 files changed, 6 insertions(+), 5 deletions(-) rename {交互 => 基本结构/松耦合}/Agent/80.py (100%) rename 基本结构/{041 插件 => 松耦合/插件}/__pycache__/tf-20.cpython-38.pyc (100%) rename 基本结构/{041 插件 => 松耦合/插件}/config.ini (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins-src/compile.sh (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins-src/frequencies1.py (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins-src/frequencies2.py (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins-src/words1.py (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins-src/words2.py (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins/frequencies1.pyc (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins/frequencies2.cpython-38.pyc (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins/words1.pyc (100%) rename 基本结构/{041 插件 => 松耦合/插件}/plugins/words2.cpython-38.pyc (100%) rename 基本结构/{041 插件 => 松耦合/插件}/tf-20.py (100%) 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()