python提取文件中的方法名称
2024-08-25 01:57:50
#提取文件中的方法名称 # -*- coding:utf-8 -*- def Query_Method(filepath): file = open(filepath,'r',encoding= 'UTF-8').readlines() print ('\n\n') str = "" for i in file: if i.startswith('def') or i.startswith(' def'): str += i[8:-4] # print(str) str += "," # print(str) return str if __name__ == '__main__': Query_Method("..\\data\\test_InitializationData.py")
最新文章
- Android开发aidl使用中linkToDeath和unlinkToDeath的使用
- etcd:用于服务发现的键值存储系统
- Hadoop之HDFS文件读写过程
- [Linux]系统调用理解(2)
- .NET 动态脚本语言Script.NET 入门指南 Quick Start
- c++map的用法 分类: POJ 2015-06-19 18:36 11人阅读 评论(0) 收藏
- liunx之tar 命令
- Strust2 <;c:forEach>; 循环控制标签
- jquery next nextAll nextUntil siblings的区别
- python学习笔记之二:使用字符串
- lua.c:80:31: fatal error: readline/readline.h: No such file or directory
- rails自动生成大量记录的方法
- c# 通过MailHelper发送QQ邮件
- java反射使用和源码解析
- SQL 语句中 where 条件后 写上1=1 的意思
- pyqt5-QWidget-窗口状态(最大化最小化等)
- HDU 3605 Escape (网络流,最大流,位运算压缩)
- aop(Aspect Oriented Programming)面向切面编程
- Egret的屏幕适配模式图示
- centos crontab详解