I want to create a Python Script that will search through a directory for a spec
ID: 3705038 • Letter: I
Question
I want to create a Python Script that will search through a directory for a specific file.
For example, the script will ask which directory and let the user choose, if the directory doesn't exist then it will return false.
After that, the user will enter a file name, ex. "name.txt", then the script will search through the whole directory to find if "name.txt" exists.
If there are two "name.txt", use their metadata to compare them and show the differences.
I don't need the whole script but any useful methods, functions that can help me finish this script is appreciated.
Explanation / Answer
Here is what you can do.
#To get metadata of files, you can do os.stat(path) it will give you file metadata. Here is descripion of metadata fields.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.