基于python写的目录/文件递归检索工具

article/2025/6/6 15:59:45

核心功能

1. 目录结构检索

  • 递归扫描 :深度遍历指定目录及其所有子目录

  • 多种检索模式

    • 仅文件夹模式:只显示目录结构
    • 仅文件模式:只显示文件列表
    • 文件+文件夹模式:完整显示目录树结构(默认模式)

2. 智能过滤系统

  • 文件后缀过滤 :支持多后缀过滤(如:.txt; .py; .jpg)

  • 屏蔽词管理

    • 支持通配符(如 .tmp; backup_
    • 可创建和管理多个屏蔽配置
    • 支持导入/导出配置

在这里插入图片描述

3. 结果输出

  • 树形结构展示 :直观显示目录层级关系

  • 可视化标识
    在这里插入图片描述

  • 统计信息 :自动生成项目数量统计

  • 结果导出 :一键导出为文本文件

在这里插入图片描述

特色功能

4. 用户友好界面

  • 直观操作 :清晰的按钮布局和分组
  • 深色主题 :减轻视觉疲劳
  • 实时状态提示 :显示当前操作状态
  • 智能路径建议 :自动生成默认输出路径

5. 配置管理

  • 配置文件存储 :配置文件保存在程序同目录
  • 多配置支持 :可创建和管理多个屏蔽配置
  • 配置导出 :支持将配置导出为JSON文件

6. 高效性能

  • 快速扫描 :优化递归算法提高效率
  • 错误处理 :自动跳过无权限访问的目录
  • 排序功能 :文件和文件夹按名称排序

使用场景

  1. 项目结构分析 :快速查看项目目录结构
  2. 文件系统清理 :识别特定类型的文件(如临时文件)
  3. 文档编制 :生成项目目录树文档
  4. 资产盘点 :统计特定类型的文件数量
  5. 系统维护 :查找分散的配置文件或日志文件

已编译好的工具: https://pan.quark.cn/s/ce0c21b939b6

附源代码

import os
import sys
import re
import json
import fnmatch
from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit,QPushButton, QRadioButton, QButtonGroup, QGroupBox, QFileDialog, QTextEdit,QComboBox, QMessageBox, QCheckBox, QListWidget, QListWidgetItem, QInputDialog
)
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont, QPalette, QColor# 获取脚本所在目录
if getattr(sys, 'frozen', False):# 如果是打包后的可执行文件APP_DIR = os.path.dirname(sys.executable)
else:# 如果是脚本文件APP_DIR = os.path.dirname(os.path.abspath(__file__))# 修改配置文件路径为脚本所在目录
CONFIG_FILE = os.path.join(APP_DIR, "config.json")class FileSearchApp(QMainWindow):def __init__(self):super().__init__()self.setWindowTitle("目录/文件递归检索工具")self.setGeometry(300, 300, 800, 650)# 初始化变量self.ignore_configs = []self.current_ignore_config = {"name": "默认配置", "patterns": []}self.load_config()# 创建UIself.init_ui()class FileSearchApp(QMainWindow):def __init__(self):super().__init__()self.setWindowTitle("目录/文件递归检索工具 V1.0 by:Sunf10wer")self.setGeometry(300, 300, 800, 650)# 初始化变量self.ignore_configs = []self.current_ignore_config = {"name": "默认配置", "patterns": []}self.load_config()# 创建UIself.init_ui()def init_ui(self):# 主布局main_widget = QWidget()main_layout = QVBoxLayout()main_widget.setLayout(main_layout)self.setCentralWidget(main_widget)# 设置标题样式title_label = QLabel("目录/文件递归检索工具")title_font = QFont("Arial", 16, QFont.Bold)title_label.setFont(title_font)title_label.setAlignment(Qt.AlignCenter)title_label.setStyleSheet("color: #FFFFFF; padding: 10px;")main_layout.addWidget(title_label)# 目录选择dir_layout = QHBoxLayout()dir_label = QLabel("目标目录:")self.dir_entry = QLineEdit()self.dir_entry.setPlaceholderText("请选择或输入要检索的目录...")browse_button = QPushButton("浏览...")browse_button.clicked.connect(self.browse_directory)dir_layout.addWidget(dir_label)dir_layout.addWidget(self.dir_entry, 4)dir_layout.addWidget(browse_button, 1)main_layout.addLayout(dir_layout)# 输出文件选择output_layout = QHBoxLayout()output_label = QLabel("输出文件:")self.output_entry = QLineEdit()self.output_entry.setPlaceholderText("输出文件名...")output_browse_button = QPushButton("浏览...")output_browse_button.clicked.connect(self.browse_output_file)output_layout.addWidget(output_label)output_layout.addWidget(self.output_entry, 4)output_layout.addWidget(output_browse_button, 1)main_layout.addLayout(output_layout)# 检索类型选择search_type_group = QGroupBox("检索类型")search_layout = QHBoxLayout()self.folder_radio = QRadioButton("仅文件夹")self.file_radio = QRadioButton("仅文件")self.both_radio = QRadioButton("文件和文件夹")self.both_radio.setChecked(True)self.search_type_group = QButtonGroup()self.search_type_group.addButton(self.folder_radio)self.search_type_group.addButton(self.file_radio)self.search_type_group.addButton(self.both_radio)# 文件后缀过滤suffix_layout = QHBoxLayout()suffix_label = QLabel("文件后缀(用分号分隔):")self.suffix_entry = QLineEdit()self.suffix_entry.setPlaceholderText("例如: .txt; .py; .jpg")suffix_layout.addWidget(suffix_label)suffix_layout.addWidget(self.suffix_entry)search_layout.addWidget(self.folder_radio)search_layout.addWidget(self.file_radio)search_layout.addWidget(self.both_radio)search_layout.addStretch()search_type_group.setLayout(search_layout)main_layout.addWidget(search_type_group)main_layout.addLayout(suffix_layout)# 屏蔽词管理ignore_group = QGroupBox("屏蔽词管理")ignore_layout = QVBoxLayout()# 屏蔽词配置选择config_layout = QHBoxLayout()config_label = QLabel("当前配置:")self.config_combo = QComboBox()self.config_combo.setMinimumWidth(150)self.config_combo.currentIndexChanged.connect(self.config_selected)new_config_btn = QPushButton("新建配置")new_config_btn.clicked.connect(self.create_new_config)config_layout.addWidget(config_label)config_layout.addWidget(self.config_combo, 1)config_layout.addWidget(new_config_btn)# 屏蔽词列表ignore_list_layout = QVBoxLayout()list_label = QLabel("屏蔽词列表(支持通配符,如 *.tmp; backup_*)")self.ignore_list = QListWidget()self.ignore_list.setAlternatingRowColors(True)add_btn = QPushButton("添加屏蔽词")add_btn.clicked.connect(self.add_ignore_pattern)remove_btn = QPushButton("移除选中")remove_btn.clicked.connect(self.remove_selected_pattern)list_btn_layout = QHBoxLayout()list_btn_layout.addWidget(add_btn)list_btn_layout.addWidget(remove_btn)ignore_list_layout.addWidget(list_label)ignore_list_layout.addWidget(self.ignore_list)ignore_list_layout.addLayout(list_btn_layout)ignore_layout.addLayout(config_layout)ignore_layout.addLayout(ignore_list_layout)ignore_group.setLayout(ignore_layout)main_layout.addWidget(ignore_group)# 操作按钮button_layout = QHBoxLayout()self.search_btn = QPushButton("开始检索")self.search_btn.setStyleSheet("background-color: #3498db; color: white; font-weight: bold; padding: 8px;")self.search_btn.clicked.connect(self.start_search)export_btn = QPushButton("导出配置")export_btn.clicked.connect(self.export_config)button_layout.addStretch()button_layout.addWidget(self.search_btn)button_layout.addWidget(export_btn)button_layout.addStretch()main_layout.addLayout(button_layout)# 状态栏self.status_bar = self.statusBar()self.status_label = QLabel("就绪")self.status_bar.addWidget(self.status_label)# 更新UIself.update_config_combo()self.update_ignore_list()# 连接信号self.dir_entry.textChanged.connect(self.update_output_filename)def load_config(self):"""从配置文件加载屏蔽词配置"""if os.path.exists(CONFIG_FILE):try:with open(CONFIG_FILE, 'r', encoding='utf-8') as f:self.ignore_configs = json.load(f)# 确保至少有一个默认配置if not any(cfg['name'] == '默认配置' for cfg in self.ignore_configs):self.ignore_configs.insert(0, {"name": "默认配置", "patterns": []})except:self.ignore_configs = [{"name": "默认配置", "patterns": []}]else:self.ignore_configs = [{"name": "默认配置", "patterns": []}]self.current_ignore_config = self.ignore_configs[0]def save_config(self):"""保存屏蔽词配置到文件"""try:with open(CONFIG_FILE, 'w', encoding='utf-8') as f:json.dump(self.ignore_configs, f, ensure_ascii=False, indent=2)return Trueexcept Exception as e:QMessageBox.critical(self, "保存错误", f"保存配置时出错: {str(e)}")return Falsedef update_config_combo(self):"""更新配置下拉框"""self.config_combo.clear()for config in self.ignore_configs:self.config_combo.addItem(config['name'])# 选择当前配置current_index = next((i for i, config in enumerate(self.ignore_configs) if config['name'] == self.current_ignore_config['name']),0)self.config_combo.setCurrentIndex(current_index)def update_ignore_list(self):"""更新屏蔽词列表"""self.ignore_list.clear()for pattern in self.current_ignore_config['patterns']:self.ignore_list.addItem(pattern)def config_selected(self, index):"""配置选择改变事件"""if 0 <= index < len(self.ignore_configs):self.current_ignore_config = self.ignore_configs[index]self.update_ignore_list()def create_new_config(self):"""创建新的屏蔽词配置"""name, ok = QInputDialog.getText(self, "新建配置", "输入配置名称:", text=f"配置{len(self.ignore_configs)+1}")if ok and name:# 检查名称是否已存在if any(cfg['name'] == name for cfg in self.ignore_configs):QMessageBox.warning(self, "名称冲突", f"配置名 '{name}' 已存在!")returnnew_config = {"name": name, "patterns": []}self.ignore_configs.append(new_config)self.current_ignore_config = new_configself.update_config_combo()self.update_ignore_list()self.save_config()def add_ignore_pattern(self):"""添加屏蔽词"""pattern, ok = QInputDialog.getText(self, "添加屏蔽词", "请输入屏蔽词(支持通配符):")if ok and pattern:if pattern not in self.current_ignore_config['patterns']:self.current_ignore_config['patterns'].append(pattern)self.update_ignore_list()self.save_config()def remove_selected_pattern(self):"""移除选中的屏蔽词"""selected_items = self.ignore_list.selectedItems()if not selected_items:returnfor item in selected_items:pattern = item.text()if pattern in self.current_ignore_config['patterns']:self.current_ignore_config['patterns'].remove(pattern)self.update_ignore_list()self.save_config()def browse_directory(self):"""浏览目录"""directory = QFileDialog.getExistingDirectory(self, "选择目录")if directory:self.dir_entry.setText(directory)self.update_output_filename()def browse_output_file(self):"""浏览输出文件"""# 获取默认输出路径default_path = self.output_entry.text() or self.get_default_output_path()# 确保默认路径包含文件名if os.path.isdir(default_path):default_path = os.path.join(default_path, self.get_default_filename())# 打开文件对话框file_path, _ = QFileDialog.getSaveFileName(self, "保存结果", default_path, "文本文件 (*.txt)")if file_path:# 确保文件扩展名正确if not file_path.endswith('.txt'):file_path += '.txt'self.output_entry.setText(file_path)def get_default_output_path(self):"""获取默认输出目录"""# 优先使用目标目录所在位置if self.dir_entry.text():return os.path.dirname(self.dir_entry.text())# 使用当前工作目录作为备选return os.getcwd()def update_output_filename(self):"""当目录改变时更新默认输出文件名"""# 仅当输出框为空时更新if not self.output_entry.text():self.output_entry.setText(self.get_default_output_path())def get_default_filename(self):"""获取默认文件名"""directory = self.dir_entry.text()if directory:# 获取目录名作为文件名基础base_name = os.path.basename(directory) or "root"return f"{base_name}_检索结果.txt"return "检索结果.txt"def export_config(self):"""导出当前配置"""if not self.current_ignore_config['patterns']:QMessageBox.information(self, "导出配置", "当前配置没有屏蔽词!")returnfile_path, _ = QFileDialog.getSaveFileName(self, "导出配置", "", "JSON文件 (*.json)")if file_path:if not file_path.endswith('.json'):file_path += '.json'try:with open(file_path, 'w', encoding='utf-8') as f:json.dump(self.current_ignore_config, f, ensure_ascii=False, indent=2)QMessageBox.information(self, "导出成功", f"配置已导出到:\n{file_path}")except Exception as e:QMessageBox.critical(self, "导出错误", f"导出配置时出错: {str(e)}")def start_search(self):"""开始检索"""# 获取输入参数target_dir = self.dir_entry.text().strip()if not target_dir or not os.path.isdir(target_dir):QMessageBox.warning(self, "目录错误", "请选择有效的目标目录!")return# 获取输出文件路径output_file = self.output_entry.text().strip()if not output_file:# 如果没有指定输出文件,使用默认文件名output_file = os.path.join(self.get_default_output_path(),self.get_default_filename())self.output_entry.setText(output_file)if not output_file.endswith('.txt'):output_file += '.txt'# 确保输出目录存在output_dir = os.path.dirname(output_file)if output_dir and not os.path.exists(output_dir):try:os.makedirs(output_dir)except Exception as e:QMessageBox.critical(self, "目录错误", f"无法创建输出目录: {str(e)}")return# 检查检索类型search_folders = self.folder_radio.isChecked()search_files = self.file_radio.isChecked()search_both = self.both_radio.isChecked()file_extensions = []if search_files or search_both:ext_str = self.suffix_entry.text().strip()if ext_str:file_extensions = [ext.strip().lower() for ext in ext_str.split(';') if ext.strip()]# 获取屏蔽词ignore_patterns = self.current_ignore_config['patterns']# 执行检索self.status_label.setText("正在检索...")QApplication.processEvents()  # 更新UItry:# 获取层级结构的检索结果results = []self.recursive_traverse(target_dir, target_dir, results, 0,search_folders, search_files,search_both,file_extensions, ignore_patterns)# 写入文件with open(output_file, 'w', encoding='utf-8') as f:# 写入头部信息f.write(f"检索目录: {target_dir}\n")if search_folders:f.write(f"检索类型: 仅文件夹\n")elif search_files:f.write(f"检索类型: 仅文件\n")else:f.write(f"检索类型: 文件和文件夹\n")if (search_files or search_both) and file_extensions:f.write(f"文件后缀: {', '.join(file_extensions)}\n")if ignore_patterns:f.write(f"屏蔽配置: {self.current_ignore_config['name']}\n")f.write(f"屏蔽词: {', '.join(ignore_patterns)}\n")f.write("\n" + "=" * 70 + "\n\n")# 写入层级结构total_items = 0total_folders = 0total_files = 0for item in results:# 根据层级深度添加缩进indent = "│   " * (item['depth'] - 1)prefix = "├── " if item['depth'] > 0 else ""# 添加文件夹/文件标识if item['type'] == 'folder':line = f"{indent}{prefix}📁 {item['name']}/"total_folders += 1else:line = f"{indent}{prefix}📄 {item['name']}"total_files += 1f.write(line + "\n")total_items += 1# 添加统计信息f.write("\n" + "=" * 70 + "\n\n")f.write(f"统计信息:\n")f.write(f"总项目数: {total_items}\n")f.write(f"文件夹数: {total_folders}\n")f.write(f"文件数: {total_files}\n")self.status_label.setText(f"检索完成!找到 {total_items} 个项目,结果已保存到: {output_file}")QMessageBox.information(self, "完成", f"检索完成!\n"f"总项目数: {total_items}\n"f"文件夹数: {total_folders}\n"f"文件数: {total_files}\n"f"结果已保存到:\n{output_file}")except Exception as e:self.status_label.setText("检索出错")QMessageBox.critical(self, "错误", f"检索过程中出错: {str(e)}")def recursive_traverse(self, root_dir, current_dir, results, depth, search_folders, search_files, search_both,file_extensions, ignore_patterns):"""递归遍历目录,保持实际目录结构"""try:# 获取当前目录下的条目entries = os.listdir(current_dir)except Exception as e:# 跳过无权访问的目录return# 排序条目entries.sort(key=lambda s: s.lower())# 获取当前目录相对于根目录的相对路径rel_dir = os.path.relpath(current_dir, root_dir)# 如果是根目录,添加根目录项if current_dir == root_dir:results.append({'name': os.path.basename(root_dir) or os.path.splitdrive(root_dir)[0],'path': root_dir,'depth': depth,'type': 'folder'})# 处理文件夹folders = [e for e in entries if os.path.isdir(os.path.join(current_dir, e))]for folder in folders:folder_path = os.path.join(current_dir, folder)rel_path = os.path.relpath(folder_path, root_dir)# 检查是否在屏蔽列表中if self.is_ignored(rel_path, ignore_patterns):continue# 添加到结果(如果需要检索文件夹)if search_folders or search_both:results.append({'name': folder,'path': folder_path,'depth': depth + 1,'type': 'folder'})# 递归处理子目录self.recursive_traverse(root_dir, folder_path, results, depth + 1,search_folders, search_files,search_both,file_extensions, ignore_patterns)# 处理文件files = [e for e in entries if os.path.isfile(os.path.join(current_dir, e))]for file in files:file_path = os.path.join(current_dir, file)rel_path = os.path.relpath(file_path, root_dir)# 检查是否在屏蔽列表中if self.is_ignored(rel_path, ignore_patterns):continue# 检查文件后缀if (search_files or search_both) and file_extensions:ext = os.path.splitext(file)[1].lower()if ext not in file_extensions:continue# 添加到结果if search_files or search_both:results.append({'name': file,'path': file_path,'depth': depth + 1,'type': 'file'})def is_ignored(self, path, patterns):"""检查路径是否与任何屏蔽模式匹配"""for pattern in patterns:if fnmatch.fnmatch(path, pattern):return Trueif pattern in path:return Truereturn Falseif __name__ == "__main__":app = QApplication([])app.setStyle("Fusion")# 设置应用样式palette = QPalette()palette.setColor(QPalette.Window, QColor(53, 53, 53))palette.setColor(QPalette.WindowText, Qt.white)palette.setColor(QPalette.Base, QColor(35, 35, 35))palette.setColor(QPalette.AlternateBase, QColor(53, 53, 53))palette.setColor(QPalette.ToolTipBase, Qt.white)palette.setColor(QPalette.ToolTipText, Qt.white)palette.setColor(QPalette.Text, Qt.white)palette.setColor(QPalette.Button, QColor(53, 53, 53))palette.setColor(QPalette.ButtonText, Qt.white)palette.setColor(QPalette.BrightText, Qt.red)palette.setColor(QPalette.Highlight, QColor(142, 45, 197).lighter())palette.setColor(QPalette.HighlightedText, Qt.black)app.setPalette(palette)window = FileSearchApp()window.show()app.exec_()

文件递归检索工具依赖库

PyQt5==5.15.9

pip install PyQt5

pyinstaller --onefile -w so.py

http://www.hkcw.cn/article/nxsboDgtQK.shtml

相关文章

Qwen3高效微调

高效微调 场景、模型、数据、算力 高效微调的应用场景 对话风格微调&#xff1a;高效微调可以用于根据特定需求调整模型的对话风格。例如&#xff0c;针对客服系统、虚拟助理等场景&#xff0c;模型可以通过微调来适应不同的 语气、礼貌程度 或 回答方式&#xff0c;从而在与…

不动产登记区块链系统(Vue3 + Go + Gin + Hyperledger Fabric)

好久没有介绍过新项目的制作了&#xff0c;之前做的一直都是Fisco Bcos的项目&#xff0c;没有介绍过Hyperledger Fabric的项目&#xff0c;这次来给大家分享下。 系统概述 不动产登记与交易平台是一个基于Hyperledger Fabric的综合性管理系统&#xff0c;旨在实现不动产登记…

深度学习学习率调度器指南:PyTorch 四大 scheduler 对决

在深度学习模型训练中&#xff0c;学习率调度器&#xff08;Learning Rate Scheduler&#xff09;是影响模型收敛效果和训练稳定性的关键因素。选择合适的学习率调度策略&#xff0c;往往能让模型性能产生质的飞跃。本文将深入对比PyTorch中最常用的四种学习率调度器&#xff0…

ERP学习-AP

业务需要。持续更新学习进度 借助网上零搭建平台上手实操 这个是简道云平台页面链接&#xff0c;登录的化去手机号登录 目前开始对应付模块进行学习

基于 ZYNQ UltraScale+ OV5640的高速图像传输系统设计,支持国产替代

引 言 随着电子信息技术的不断进步&#xff0c;人工智能、医 疗器械、机器视觉等领域都在高速发展 [1] &#xff0c;工业相机 是机器视觉系统中的一部分 [2] &#xff0c;对工业相机而言&#xff0c;传 输图像的速率、传输过程的抗干扰能力是其关键&#xff0c; 工业相…

smartGit 试用突破30天

1 下载 选择19.1版本 2 运行 我是linux环境 解压后, cd bin ./smartgit.sh 选择使用30天. 然后退出 3 绿色软件 破解步骤 下载破解文件&#xff1a;访问 Gitee 链接 goto下载下载破解文件 解压文件&#xff1a;下载后解压得到 crackSmartGit.jar 和 license.zip 用编辑…

一、基础环境配置

一、虚拟机 主&#xff1a;192.168.200.200 从&#xff1a;192.168.200.201 从&#xff1a;192.168.200.202 二、docker docker基础搭建&#xff0c;有不会的自行百度。 1.目录结构 /opt/software&#xff1a;软件包/opt/module&#xff1a;解压包&#xff0c;自定义脚本…

Java面试八股--08-数据结构和算法篇

1、怎么理解时间复杂度和空间复杂度 时间复杂度和空间复杂度一般是针对算法而言&#xff0c;是衡量一个算法是否高效的重要标准。先纠正一个误区&#xff0c;时间复杂度并不是算法执行的时间&#xff0c;在纠正一个误区&#xff0c;算法不单单指冒泡排序之类的&#xff0c;一个…

Oracle中的循环——FOR循环、WHILE循环和LOOP循环

目录 一、FOR循环 1.FOR循环语法结构 二、WHILE循环 1.WHILE循环语法结构 三、LOOP循环 1.LOOP循环语法结构 四、三个循环的区别(重要) Oracle中的循环常用的有&#xff1a;FOR循环、WHILE循环和LOOP循环 一、FOR循环 1.FOR循环语法结构 DECLARE --不声明变量&…

ubuntu 20.04挂载固态硬盘

我们有个工控机&#xff0c;可以接入一个固态硬盘。将固态硬盘插好后&#xff0c;就要进行挂载。在AI的指导下&#xff0c;过程并不顺利。记录如下&#xff1a; 1、检查硬盘是否被识别 安装好硬盘后&#xff0c;运行以下命令来检查Linux系统是否已识别新硬盘&#xff1a; …

SAP 自动编号的使用

1、NUMBER_RANGE_ENQUEUE用于锁定编号范围对象&#xff0c;防止多用户并发访问冲突 2、NUMBER_RANGE_DEQUEUE用于解锁已维护的编号范围对象。 3、此外&#xff0c;还提到了NUMBER_GET_NEXT函数模块&#xff0c;用于获取编号范围内的下一个号码。 文章目录 创建编号范围程序实现…

Python趣学篇:从零打造智能AI井字棋游戏(Python + Tkinter + Minimax算法)

名人说&#xff1a;路漫漫其修远兮&#xff0c;吾将上下而求索。—— 屈原《离骚》 创作者&#xff1a;Code_流苏(CSDN)&#xff08;一个喜欢古诗词和编程的Coder&#x1f60a;&#xff09; 专栏介绍&#xff1a;《Python星球日记》 目录 &#x1f3ae; 前言一、项目概述与技术…

[定昌linux开发板]设置密码策略

找到etc/pam.d/目录下的common-password 2.先把common-password给复制一份&#xff0c;避免改错了 可以看到新增了一个common-password.bak文件 3.打开common-password,增加密码策略 输入&#xff1a; sudo vi /etc/pam.d/common-passwod 打开common-password文件 点击&…

Godot 敌人生成半径和围墙不匹配,导致敌人错误的生成在围墙外的解决代码

一、原视频 3. Preventing Invalid Spawning 二、原代码 func get_spawn_position():var player get_tree().get_first_node_in_group("player") as Node2Dif player null:return Vector2.ZEROvar spawn_position Vector2.ZEROvar random_direction Vector2.RIG…

LabVIEW磁悬浮轴承传感器故障识别

针对工业高端装备中主动磁悬浮轴承&#xff08;AMB&#xff09;的位移传感器故障检测需求&#xff0c;基于 LabVIEW 平台构建了一套高精度故障识别系统。通过集成品牌硬件与 LabVIEW 的信号处理能力&#xff0c;实现了传感器探头故障的实时监测与精准定位&#xff0c;解决了传统…

Qt开发:QThreadPool的介绍和使用

文章目录 一、QThreadPool 简介二、常用函数简介三、完整示例 一、QThreadPool 简介 QThreadPool 是 Qt 提供的用于高效管理线程资源的类。它通过线程池的方式管理和复用线程&#xff0c;适合处理大量、短时间运行的任务&#xff0c;避免频繁创建和销毁线程带来的性能开销。 常…

蚂蚁感冒--思维

1.相遇后不用考虑转头&#xff0c;继续走就可以 2.思维&#xff0c;不只是傻傻的模拟&#xff0c;要总结出规律&#xff0c;什么情况一定可以感染&#xff0c;然后感染之后再怎么这么样 P8611 [蓝桥杯 2014 省 AB] 蚂蚁感冒 - 洛谷 #include<bits/stdc.h> using names…

non-autoregressive sequence generation

非自回归non-autoregressive 传统rnn是autoregressive,而且encode和decode都是根据上一个input/output,这样花费的时间就和句子长度成正比 transformer的输入是并行的,但是decode阶段还是autoregressive 单纯把影像当成 NM 个独立像素去拟合&#xff0c;会缺乏像素之间的依赖…

实验设计与分析(第6版,Montgomery著,傅珏生译) 第10章拟合回归模型10.9节思考题10.1 R语言解题

本文是实验设计与分析&#xff08;第6版&#xff0c;Montgomery著&#xff0c;傅珏生译) 第10章拟合回归模型10.9节思考题10.1 R语言解题。主要涉及线性回归、回归的显著性、回归系数的置信区间。 vial <- seq(1, 10, 1) Viscosity <- c(160,171,175,182,184,181,188,19…

如何选择最高效的沟通方式?

日常沟通主要分为文字、语音和面对面三种形式&#xff0c;选择何种方式需根据沟通内容的复杂程度、决策难度及互动需求综合判断。 当沟通内容简单明确、以信息传递为主或涉及基础决策时&#xff0c;文字或语音是更高效的选择。这类方式不仅能降低时间成本&#xff0c;还能避免…