must use Python3
This assignment feeds into programming assignment #5. In this assignment, you will read a file (its name is passed as a command argument) that contains many text lines, each containing "@." commands. Most of the resulting information will be placed in associative arrays (dictionaries). There are three types of @. commands: VAR, FORMAT, PRINT. Your code should detect errors in the text lines and print error messages (and not terminate). See the sample output. @. VAR @varName=value Use the varName as a key in an associative array with the value as the value. Examples: @. VAR @first=Jon @. VAR @last=Doe @. VAR @petName=Pete @. VAR @street="123 HOUSTON" @. VAR @city="EL PASO" @. VAR @state=TX @. VAR @zip=78216 @. VAR @title=Mr. The value for @street will be 123 HOUSTON without the double quotes although those are in the data text line. This allows the value to contain spaces. If it is an invalid @varname=value, show an error message and continue with the next text line. @. FORMAT tag1=value1 tag2=value2 ... Use the tag as a key in an associative array with the value as the value. As shown, there can be many tag-value pairs. An @. FORMAT command will only change the value of the specified tag(s); the values of the other tags will be unchanged. These are the valid tag keys: LM, RM, JUST, BULLET, FLOW. For the JUST tag, the values must be LEFT, RIGHT, BULLET or CENTER. If an invalid value is given, show an error message, but continue. Default values (at the beginning of your code): FLOW is "YES", LM is "1", RM is "80", JUST is "LEFT", and BULLET is "o". Note that the value of BULLET is meaningless when JUST isn't "BULLET". Do not reset to the default values once your code begins. Examples: @. FORMAT LM=5 RM=70 JUST=LEFT @. FORMAT FLOW=NO JUST=LEFT @. FORMAT JUST=BULLET BULLET=o @. PRINT VARS Print the variable names and corresponding values from the Variable associative array. Use: pprint.pprint(variableDict, width=30) @. PRINT FORMAT Print the current value for each of the five tags. Use: pprint.pprint(formatDict, width=30) Coding Requirements Your program must be separated into multiple functions and source files. The main driver must be in p4Driver.py file and the code for setting variables and setting formats must be in p4At.py file. To import code from another file, use a Python statement like this: from fileName import funcName1, funcName2 Note the actual file would be named fileName.py. Inotherwords, the filename specified on the from would be without the.py. You must create at least two functions to be used by your code: setVariable(atString, varDictionary) and setFormat(atString, formatDictionary). These should be placed in p4At.py. The atString is the remainder of the string after the VAR or FORMAT key word. You must also create the driver program. It should be placed in p4Driver.py, and it should use setVariable and setFormat. Please make certain you document your code. I will provide a data file to use for the output you turn in. What to turn in? To simplify the grading process for your TA, please turn in a zip file named LastNameFirstName.zip (no spaces) containing: · Source python files (p4Driver.py and p4At.py) · Your output file named p4Out.txt. · Do not include directories in the .zip file. Sample Input: @. VAR @first=Jon @. VAR @last=Doe @. PRINT VARS @. VAR @petName=Pete @. VAR @street="123 HOUSTON" @. VAR @city="EL PASO" @. VAR @state=TX @. VAR @zip=78216 @. VAR @title=Mr. @. PRINT VARS @. FORMAT LM=5 JUST=LEFT @. PRINT FORMAT @. FORMAT JUST=RIGHT FLOW=NO @. PRINT FORMAT @. FORMAT JUST=BULLET BULLET=o RM=70 FLOW=YES @. PRINT FORMAT @. SOME BAD STUFF @. FORMAT BAD=LEFT @. FORMAT LM=10 JUST=FLOW @. FORMAT LM=10 RM=60 JUST=RIGHT Sample Output: {'first': 'Jon', 'last': 'Doe'} {'city': 'EL PASO', 'first': 'Jon', 'last': 'Doe', 'petName': 'Pete', 'state': 'TX', 'street': '123 HOUSTON', 'title': 'Mr.', 'zip': '78216'} {'BULLET': 'o', 'FLOW': 'YES', 'JUST': 'LEFT', 'LM': '5', 'RM': '80'} {'BULLET': 'o', 'FLOW': 'NO', 'JUST': 'RIGHT', 'LM': '5', 'RM': '80'} {'BULLET': 'o', 'FLOW': 'YES', 'JUST': 'BULLET', 'LM': '5', 'RM': '70'} *** Not a recognizable command, found: @. SOME BAD STUFF *** Invalid format, found: BAD=LEFT *** Bad value for JUST=, found: FLOW {'BULLET': 'o', 'FLOW': 'YES', 'JUST': 'CENTER', 'LM': '10', 'RM': '60'}