Answer:
from sys import argv
script, filename = argv
with open( filename ) as file:
line_counter = 0
while True:
extract_line = file.readlines( )
line_counter += 1
character_count = extract_line.count( )
print( " line number: { } , character count: { }". format( line_counter, character_counter )
print ( " Nothing left to count" )
file.close( )
Step-by-step explanation:
The 'argv' is a module in the python system package, which allows for user input and script execution in the command. It loads the script and the file as a tuple which is offloaded in the script like arguments in a function.