#!/usr/bin/env python # import required modules # import os import sys # main: this is the main function of this Python # def main(argv): # open the file # fp = open(sys.argv[1], "r") # loop over the lines in the file # d = {} #d["joe"] = int(0) for line in fp: # find a line that begins with "duration" # if ("duration of recording" in line) and ("secs" in line): parts = line.split() #print("found one: ", parts[5]) try: d[parts[5]] += int(1) except: d[parts[5]] = int(1) # close the file # fp.close() # print the results # print(d) # exit # return (1) # begin gracefully # if __name__ == "__main__": main(sys.argv) # # end of file