On 2015-05-19, Cecil Westerhof <ce...@decebal.nl> wrote: > It looks like that this does what I want (the dot is needed so that it > also works with 2.7): > files = sorted(os.listdir('.')) > p = re.compile('actions-2015-05-[0-9][0-9].sql$') > current_month = [ file for file in files if p.match(file) ]
You could instead do (in Python 2 or 3): files = glob.glob("actions-2015-05-[0-9][0-9].sql") files.sort() -- https://mail.python.org/mailman/listinfo/python-list