如果你想要把指定目錄中所有的 strings.xml 全部找出來, 你可以用下面的範例
from IPython.display import display
import numpy
import os
import shutil
import fnmatch
# walk the the folder to search *.xml
top = os.getcwd()
for root, dirnames, filenames in os.walk(top, topdown=False):
for file in filenames:
if fnmatch.fnmatch(file, '*.xml'):
print('filename = ', file)
print('full file name = ', os.path.abspath(os.path.join(root, file)))
print('done.')
|