# -*- coding: utf-8 -*- def findfile(str): import os,os.path for dirs, listdir, files in os.walk('.'): for f in files: if os.path.splitext(f)[0] == str: print('%s\\%s' % (dirs,f)) if __name__ == '__main__': str = input('输入你搜索的文件名:') findfile(str)
Sign in to make a reply
国风人已变