# 这是一个示例 Python 脚本。
# 按 Shift+F10 执行或将其替换为您的代码。
# 按 双击 Shift 在所有地方搜索类、文件、工具窗口、操作和设置。
# !/usr/bin/python
import sys
output_file = sys.argv[1]
def print_hi(name):
# 在下面的代码行中使用断点来调试脚本。
print(f'Hi, {name}') # 按 Ctrl+F8 切换断点。
# 按间距中的绿色按钮以运行脚本。
if __name__ == '__main__':
print_hi('PyCharm')
# cfg_list_handle = open('E:\delay_process\cfg_list.f', 'r') # the input file
cfg_list_handle = open(output_file, 'r') # the input file
cfg_list = cfg_list_handle.readlines()
delay_classify_list = []
for line in cfg_list:
line = line.strip('\n')
cfg_handle = open(line, 'r')
cfg = cfg_handle.read()
in_list_flag = 0 # whether the delay_cfg is in delay_classify_list
for i, cfg_line in enumerate(delay_classify_list):
if cfg == cfg_line:
in_list_flag = 1
delay_classify_list.insert(i + 1, line)
break
if in_list_flag == 0:
delay_classify_list.append(cfg)
delay_classify_list.append(line)
with open('delay_classify.cfg', 'w') as f: # the output file
s = '\n'.join(delay_classify_list) # 通过'\n'将后面的列表里的字符串连接起来,很常用
f.writelines(s)
print('the delay cfg file has been classified~~~')
cfg_list_handle.close()
# 访问 https://www.jetbrains.com/help/pycharm/ 获取 PyCharm 帮助
没有合适的资源?快使用搜索试试~ 我知道了~
一种根据N个文件的内容进行分类的python脚本
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共7个文件
cfg:5个
f:1个
py:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
需积分: 0 0 下载量 87 浏览量
2023-05-02
23:42:52
上传
评论
收藏 1KB 7Z 举报
温馨提示
一种根据N个文件的内容进行分类的python脚本
资源推荐
资源详情
资源评论
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 7 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
qq_34105425
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- 前端面试题之Html相关题集.zip
- Python智能推荐系统案例介绍: 基于用户行为数据和机器学习算法,设计一个个性化推荐系统,如电影推荐、音乐推荐等
- Animation engine for explanatory math videos 用于解释数学视频的动画引擎
- Python自然语言处理应用案例介绍: 开发一个能够进行文本情感分析、语义理解或机器翻译等任务的自然语言处理应用
- Python基于深度学习的图像识别系统案例介绍: 利用深度学习技术,设计一个能够识别物体、人脸或文字等图像内容的系统
- 海信智能电视刷机数据 LED43K300U(0000) 生产用软件数据 务必确认机编一致 强制刷机 整机USB升级程序
- zookeeper-api基础.docx
- matplotlib是一个用于绘制图表和可视化数据的 Python 库.docx
- comfyui 提示词 参考;来源GitHub
- 一款零配置、无骨架、极小化的Hyperf发行版,通过Nano可以让您仅仅通过1个PHP文件即可快速搭建一个Hyperf应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)