Question: I need help debugging a python code. import os import sys import time import datetime try: ### print ('Number of arguments:', len(sys.argv), 'arguments.') ### print

I need help debugging a python code.

import os import sys import time import datetime try: ### print ('Number of arguments:', len(sys.argv), 'arguments.') ### print ('Argument List:', str(sys.argv)) print("entd261:",sys.argv[1]) print("kb:", int(sys.argv[2])) # Open a file path = sys.argv[1] dirs = os.listdir( path ) # This would print all the files and directories for file in dirs: ## filter by size if os.stat(file).st_size > int(sys.argv[2]): ## convert atg string to int ### next line will print date unformatted ### print (file, os.stat(file).st_size, time.getime(os.path.getmtime(file))) print (file, os.stat(file).st_size, time.getime(os.path.getmtime(file)).tm_year)

except: print("Unexpected error:", sys.exc_info()[0]) raise "else" print(" ")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!