Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

from __future__ import print_function ''' Week Two Assignment 2 - File Hashing ''' ''' Complete the script below to do the following: 1) Add your

from __future__ import print_function

''' Week Two Assignment 2 - File Hashing '''

''' Complete the script below to do the following: 1) Add your name, date, assignment number to the top of this script 2) Using the os library and the os.walk() method a) Create a list of all files b) Create an empty dictionary named fileHashes c) Iterate through the list of files and - calculate the md5 hash of each file - create a dictionary entry where: key = md5 hash value = filepath d)Iterate through the dictionary - print out each key, value pair 3) Submit NamingConvention: lastNameFirstInitial_Assignment_.ext for example: hosmerC_WK1_script.py hosmerC_WK1_screenshot.jpg A) Screenshot of the results in WingIDE B) Your Script '''

import os import hashlib

directory = "."

fileList = [] fileHashes = {}

for root, dirs, files in os.walk(directory):

# Walk the path from top to bottom. # For each file obtain the filename for fileName in files: path = os.path.join(root, fileName) fullPath = os.path.abspath(path)

I am stuck here, instructions are included above. Python please

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

=+what kinds of policies and practices should be developed?

Answered: 1 week ago

Question

=+ Of the HR issues mentioned in the case,

Answered: 1 week ago