python学习笔记_文件遍历
来源:互联网 发布:嵌入式linux常用命令 编辑:程序博客网 时间:2024/06/06 17:18
文件遍历python
- #!usr/bin/env python
- # -*- coding: UTF-8 -*-
- import os
- import string
- def vistDir2(path):
- list_dirs = os.walk(path)
- result=[]
- for root ,dirs,files in list_dirs:
- print root
- print dirs
- print files
- '''''
- for d in dirs: #得到所有的目录
- print os.path.join(root,d)
- '''
- for file in files: #得到所有的文件
- temp = os.path.join(root,file)
0 0
- python学习笔记_文件遍历
- python学习笔记_文件遍历
- Python学习笔记-遍历文件
- Python学习 文件遍历
- python基础教程_学习笔记21:文件和素材
- python学习(文件遍历)
- python学习笔记_基础
- Python学习笔记_数字
- Python学习笔记_函数
- Python学习笔记_文件系统
- Python学习笔记_数据类型
- python学习笔记-(6)循环遍历
- Python 遍历字典——学习笔记
- Python学习笔记(21)-目录遍历
- Python学习笔记 --- 循环遍历时间区间
- 我的python学习笔记.遍历字典
- Python学习系列(七)---遍历文件目录
- python学习笔记:实现一个遍历文件寻找字符串的功能
- 图论总结
- 理解 Linux 的硬链接与软链接(三)
- fedora 解决android studio ADB not responding.
- C语言无符号有符号比较问题总结
- Balanced Lineup(RMQ)(POJ 3264)
- python学习笔记_文件遍历
- Python 爬虫把美空的图片都扒下来了
- POJ3169Layout差分约束
- A - Message Flood(字典树)
- 【1241】Oil Deposits(HDU)
- 快速计算子网掩码和主机数
- UNION运算符
- PHP中break及continue两个流程控制指令解析
- hdfs中修改文件块大小方法