Alaxn's Blog
Record for myself and share with you.
12345678910111213141516
#! /usr/bin/python# -*- coding: utf-8 -*-import osdef getFileName(path): f_list = os.listdir(path) for i in f_list: if os.path.splitext(i)[1] == '.log': print iif __name__ == '__main__': path = '/my/project' getFileName(path)