Implemented function to list data files

Update function to list data files

Follow Style Guidelines

Add doc for listing files
This commit is contained in:
CyberDrudge 2019-01-17 00:35:27 +05:30 committed by Bryan W. Weber
parent a5b28ba799
commit 65f7b16f01

View file

@ -0,0 +1,15 @@
from pathlib import Path
def list_data_files(ext=''):
"""
Lists input data files.
:param ext:
Extension of files to be displayed.
:return:
List of input data files.
"""
here = Path(__file__).parent
data_files = [x.name for x in here.iterdir() if not x.name.startswith('__') and x.name.endswith(ext)]
return data_files