Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote