How to List all Files/Folders/Directories in Python 2022-08-20 29 words - 1 min read If you need to list all Files, Folders, or Directories in Python code, then you can use the listdirs method from the os package. 1 2 import os print(os.listdir("/path/to/directory/")