get file directory python from full path code example
Example 1: python get filename from path
import os
print(os.path.basename(your_path))
Example 2: get files in directory python
import os
files_and_directories = os.listdir("path/to/directory")