get file from directory by name python 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")
import os
print(os.path.basename(your_path))
import os
files_and_directories = os.listdir("path/to/directory")