generate functionWed, 16 Nov 2022

list the file pattern starts with s

import os from os import listdir from os.path import isfile, join def list_starts_with_s(path): files = [f for f in listdir(path) if isfile(join(path, f))] return [f for f in files if f.startswith("s")] list_starts_with_s("/tmp/")

Questions about programming?Chat with your personal AI assistant