all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
import fnmatch
|
||||
import os
|
||||
|
||||
rootPath = '/'
|
||||
pattern = '*.mp3'
|
||||
|
||||
for root, dirs, files in os.walk(rootPath):
|
||||
for filename in fnmatch.filter(files, pattern):
|
||||
print( os.path.join(root, filename))
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
from fnmatch import fnmatch
|
||||
import os, os.path
|
||||
|
||||
def print_fnmatches(pattern, dir, files):
|
||||
for filename in files:
|
||||
if fnmatch(filename, pattern):
|
||||
print os.path.join(dir, filename)
|
||||
|
||||
os.path.walk('/', print_fnmatches, '*.mp3')
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
from path import path
|
||||
|
||||
rootPath = '/'
|
||||
pattern = '*.mp3'
|
||||
|
||||
d = path(rootPath)
|
||||
for f in d.walkfiles(pattern):
|
||||
print f
|
||||
Loading…
Add table
Add a link
Reference in a new issue