效果如下:

代码:

import os

class ReadImageName():
def __init__(self):
self.path = '.' def readname(self):
filenames = os.listdir(self.path)
flielist = [] for item in filenames:
if item.endswith('.jpg'):
itemname = os.path.join(self.path, item)
itemname = itemname[-11:]
flielist.append(itemname) fo = open("imagename.txt", "w")
for item in flielist:
fo.write(str(item) + "\n") if __name__ == '__main__':
log = ReadImageName()
log.readname()

  

最新文章

  1. quick-3.5 eclipse android
  2. ASP.NET MVC3 模板页的使用
  3. Spring表达式语言 之 5.4在Bean定义中使用EL(拾伍)
  4. 华为OJ:火车进站
  5. mysql performance schema的即时诊断工具-邱伟胜
  6. live555 源代码简单分析1:主程序
  7. WebApp 里Meta标签大全
  8. 图像预处理(Evision)
  9. Azure Messaging-ServiceBus Messaging消息队列技术系列7-消息事务
  10. 存储与服务器的连接方式对比(DAS,NAS,SAN)
  11. 当Django中Debug=False,静态文件处理方式。
  12. Error in loadNamespace 的解决之道
  13. 56.关于vue项目的seo问题
  14. 转:@ControllerAdvice + @ExceptionHandler 全局处理 Controller 层异常
  15. JQ初学总结一
  16. 出现Running Android Lint的错误
  17. Android xUtils3源代码解析之网络模块
  18. C#webBrowser使用代理服务器的方法winform
  19. ubuntu下编译源码 make 出现 make: 'Makefile' is up to date.
  20. java中i = i++问题

热门文章

  1. lunux多线程编程
  2. boost::operators
  3. leetcode191 Number of 1 Bit
  4. 【二分答案】Codeforces Round #402 (Div. 2) D. String Game
  5. 【线段树】Gym - 100507C - Zhenya moves from parents
  6. 微服务之SpringCloud实战(四):SpringCloud Eureka源码分析
  7. 表或视图不存在 Hibernate Oracle
  8. 一道综合练习题实践list及dictionary集合类
  9. [Lync]lync同步通讯簿
  10. WebLogic Server 关键优化指标