Python how to list files under a directgory

There are so many ways, but in python 3 looks the most popular way is using pathlib. Here is an example to list all
files starting with bar under dir /foo

1
[x.absolute() for x in pathlib.Path("/foo").glob("bar*")]