码迷,mamicode.com
首页 >  
搜索关键字:walk    ( 975个结果
输出文件夹大小
import os, re """ 查看文件夹下的所有文件及文件夹 join为拼接函数 """ def Look_File(path): for root , dirs, files in os.walk(path): print(root) #主目录 for item in files: #主目录... ...
分类:其他好文   时间:2018-01-31 01:10:12    阅读次数:175
关于搜索全部文件和修改文件名的方法os.walk() 和os.listdir
os.walk()遍历所有的文件并列出各级,os.listdir()只列出当前文件下的条目,一个列表 1.os.walk() 大材小用。 2,listdir() ...
分类:其他好文   时间:2018-01-31 00:53:12    阅读次数:524
Python文件操作
对文件进行打包操作 import osimport tarfile#压缩,创建.gz#创建压缩包名tar = tarfile.open('/tmp/tartest.tar.gz','w:gz')# 创建压缩包for root,dir,files in os.walk("/tmp/tartest"):... ...
分类:编程语言   时间:2018-01-27 15:31:43    阅读次数:203
November 01st, 2017 Week 44th Wednesday
People always want to lead an active life, and is not it? 人们总要乐观生活,不是吗? Be active, and walk towards things you want to touch. Even if it is far away f ...
分类:其他好文   时间:2018-01-21 12:32:32    阅读次数:148
PHP-数组小记(二)
1.count() 2.array_count_values()和array_unique() 3.array_filter() 4.array_walk() 5.sort()和asort() 6.ksort() 7.自定义排序 ...
分类:编程语言   时间:2018-01-20 20:29:54    阅读次数:172
洛谷——P1821 [USACO07FEB]银牛派对Silver Cow Party
P1821 [USACO07FEB]银牛派对Silver Cow Party 题目描述 One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow part ...
分类:其他好文   时间:2018-01-06 16:01:03    阅读次数:166
Python:扫描目录下的所有文件
扫描目录下的所有文件并返回文件的绝对路径 ...
分类:编程语言   时间:2018-01-05 15:52:52    阅读次数:197
Walk Through the Fire,Is there a way out
生活百般滋味,人生需要笑对
分类:其他好文   时间:2018-01-04 13:07:55    阅读次数:238
python列出指定目录下的所有目录和文件
import os import docx def scanfile(rootdir): result = [] for f in os.walk(rootdir): for files in f[2]: if files.endswith('.py'): result.append(os.path... ...
分类:编程语言   时间:2018-01-03 11:38:54    阅读次数:157
POJ2230 Watchcow
POJ - 2230 Watchcow Watchcow Bessie's been appointed the new watch-cow for the farm. Every night, it's her job to walk across the farm and make sure t ...
分类:其他好文   时间:2018-01-01 16:54:16    阅读次数:192
975条   上一页 1 ... 38 39 40 41 42 ... 98 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!