diff --git a/word_count.py b/word_count.py index af78f28..ba2533c 100644 --- a/word_count.py +++ b/word_count.py @@ -5,8 +5,8 @@ parser = argparse.ArgumentParser( description="" ) parser.add_argument( - "arg", - help="what does this do?", + "data_file", + help="oath to the file we want to read", ) #------------------------------------------------------------------------------- @@ -15,6 +15,38 @@ args = parser.parse_args( ) +print("args = ", args) +print("args.data_file = ", args.data_file) + +fh = open(args.data_file) +print("the file handle is", fh) + +words=0 +lines=0 +chars=0 + +for line in fh: + lines+=1 + +print(lines) + + + + + + + + + + + + + + + + + + #------------------------------------------------------------------------------- # our code for analyzing the data #-------------------------------------------------------------------------------