Final Project of Using Python to Interact with the Operating System
What we'll do in Brief Use regex to parse a log file for keyword INFO and ERROR Append and modify values in a dictionary| Two separate dictionaries for INFO and ERROR Write to a file in CSV format |, Two CSV files Move files to the appropriate directory for use with the CSV->HTML converter| The conversion program is already provided. We have not to create/develope conversion utility. #ticky_check written by Me and with My own Login without using import csv utility only in 31 lines a in very simple way #!/usr/bin/env python import re import operator users={} errors={} with open('syslog.log') as logfile: for line in logfile: line=line.strip() # to trim \n user = re.search(r'\((.+)\)$',line) if user[1] not in users: users[user[1]]=(0,0) #(info,error) if 'INFO' in line: #s...