import os dir_path = os.path.dirname(os.path.realpath(__file__))
import os files_and_directories = os.listdir("path/to/directory")
from pathlib import Path for txt_path in Path("/path/folder/directory").glob("*.txt"): print(txt_path)
import pathlib pathlib.Path(__file__).parent.absolute()
import os cwd = os.getcwd()