Discuss / Python / 交作业

交作业

Topic source
import os

def findFile (str,dir = os.path.abspath('.')):
    for x in os.listdir(dir):
        if os.path.isdir(os.path.join(dir,x)):
            findFile(str,os.path.join(dir,x))
        elif str in x:
            print(os.path.join(dir,x))

  • 1

Reply