python get path of all files in directory code example
Example 1: python get all file names in directory
import glob
print(glob.glob("/home/adam/*.txt"))
Example 2: how to get all folders on path in python
os.walk(directory)
[x[0] for x in os.walk(directory)]
Example 3: list files python
import glob
files=glob.glob(given_path)
Example 4: list directory in python
from os import listdir
## Prints the current directory as a list (including file types)
print(os.listdir())