Posted 4 years agoUpdated 2 years agoDev / PythonPython how to list files under a directgoryThere are so many ways, but in python 3 looks the most popular way is using pathlib. Here is an example to list allfiles starting with bar under dir /foo 1[x.absolute() for x in pathlib.Path("/foo").glob("bar*")]#devpython