Skip to content

Instantly share code, notes, and snippets.

@yatakeke
Last active November 28, 2019 05:29
Show Gist options
  • Save yatakeke/1c88715e429f7e21e931b15d5d0739c8 to your computer and use it in GitHub Desktop.
Save yatakeke/1c88715e429f7e21e931b15d5d0739c8 to your computer and use it in GitHub Desktop.
from glob import glob
from os import path
def listup_file_name(data_path, extension=None, abspath=True):
extension = '.' + extension if extension else ''
if abspath:
return glob(data_path + '*' + extension)
else:
return glob(path.relpath(data_path + '*' + extension))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment