Discuss / Python / 第二题解答

第二题解答

Topic source

Kisionl

#1 Created at ... [Delete] [Delete and Lock User]

import os import re

def findfile(path, str): for x in os.listdir(path): if os.path.isfile(x): match = re.compile(str).match(str) if match: print(os.path.join(path, x)) else: findfile(os.path.join(path, x), str) findfile('.', 'py')

好强!


  • 1

Reply