本文整理匯總了Python中Directory.filenames方法的典型用法代碼示例。如果您正苦於以下問題:Python Directory.filenames方法的具體用法?Python Directory.filenames怎麽用?Python Directory.filenames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Directory
的用法示例。
在下文中一共展示了Directory.filenames方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: editFiles
# 需要導入模塊: import Directory [as 別名]
# 或者: from Directory import filenames [as 別名]
def editFiles(self, dirName, pattern):
if not self.isReady:
print "FileEditor is not ready"
return
dir = Directory(dirName)
filenames = dir.filenames(pattern)
for filename in filenames:
self.editFileBlocks(filename)
示例2: Grep
# 需要導入模塊: import Directory [as 別名]
# 或者: from Directory import filenames [as 別名]
#!/usr/bin/env python
from Grep import *
from Directory import *
x = Grep()
x.addFilter(r'UTIL_THROW')
d = Directory(r'.')
filenames = d.filenames('*.cpp')
for filename in filenames:
x.grep(filename)
if x.results[0]:
print filename
x.clearResults()