Assignment Instructions


This project addresses the automation of command execution in python. You need to design and
implement a software that executes several commands automatically and produces a well-defined
report (log). A software like this can be used in Automation testing to run some scenarios at various
environments to check if a specific behavior break.
You need to follow the following steps:
• Command Implementation: you need to implement the following commands in python:
o Grep : check if a given file is within a specific directory (including its
o Mv_last : move the most recent file from source
directory to destination directory.
o Categorize : split files in the given directory into 2 types
▪ An inner directory with files less than
▪ An inner directory with files more than

• Main Class/Script: You need to implement a class that reads predefined scripts based on the
upper commands and parse/execute them. In other words, you need to implement a class/script
that uses your codes from the first step.
• Configuration: We will use python JSON as our configuration file. It will be .json file in your
project where it contains main values that you need to run the application. Our json file will
specify the following:
o Threshold_size: the value that is need by the command categorize.
o Max_commands: the maximum commands that should be executed per script.
Otherwise, script raises an error.
o Max_log_files: the maximum number of file in the log directory. Otherwise, you need to
delete the oldest one.
o Same_dir: place PASSED and FAILED at the same directory or not. If not, create internal
pass and fail subdirectories. A passed script when all lines pass execution.
o Output: we will support two types of results – csv and log files:
▪ Csv: if csv if chosen, the output should be 2 columns, each statement with the
result – include a pass or fail word in the name of the file.
▪ Log: print each statement with its result in the file – include a pass or fail word
in the name of the file.

• Option Parser: We will use python option parser to specify input script file and output log result.
Check the example.
• Logging: python logging module should be used for debugging and producing final script result –
no print statements should be used.

You have the following script.txt file
Your application should take 2 inputs:
• Script path (-s)
• Output log file (-o)
Python parser -s “input/script/path” -o “output/script/path”

You also need to have configuration.json file that looks like:
” Threshold_size “: “10KB”,
” Max_commands “: “5”,
” Max_log_files “: “7”,
” Same_dir “: False,
” output “: “csv”
• Check the Factory design pattern in python to help you structure command codes. Remember you
have several types of command.
• For each run, create a python dictionary and save the result of each command on the run, at the end, parse the dictionary to provide your final log.
• Check how to parse JSON files in python → very easy and straightforward.
• Check logging library in python, very simple and provides a better way to control logs.
• Check python option parser to create -f and -o.

The post ENCS313- Python first appeared on Krita Infomatics.


Calculate Price

Price (USD)

Why Choose Us For Your Assignment?


We value all our customers' privacy. For that reason, all information stays private and confidential and will never be shared with third parties.


With our service you will never miss a deadline. We use strict follow-ups with our writers to ensure that all papers are submitted on time.


We have no tolerance for plagiarism. All papers go through thorough checking to ensure that no assignments contain plagiarism.

Money Back

You feel unsatisfied with your results? No worries. We offer refunds to our customers if any paper is not written according to the instructions.

Clients Love Us

Client #121678
Client #121678
Read More
This is by far the best I have ever scored in a custom essay. I am surprised the writer handled this assignment so well despite the short notice. I will definitely use your service next time.
Client #21702
Client #21702
Read More
When I was recommended to you by my friends, I wasn't sure you could deliver excellent results for Masters research papers until I submitted my first order. I am all yours now.
Client #20730
Client #20730
Read More
Excellent Services! You are the only assignment helper I can rely on. I have worked with many before and your services are exceptional. I have recommended you to my friends and the results are similar.
Client #20387
Client #20387
Read More
I rarely write reviews online but your services are worth promoting. My paper was so urgent I was sure I was gonna miss the deadline but you turned things around. You are awesome!
Client #20189
Client #20189
Read More
I am a satisfied customer. I know I should have given a 5 star because you deserve it but I will give 4.6 because I almost missed a deadline because of a revision. Luckily it was minor and the writer acted promptly.
Client #20187
Client #20187
Read More
Great paper but there is still some room for improvement. I am impressed by your fast responses and how you tacked my concerns professionally. Thank you for being among the few genuine essay writing service providers.
Client #19783
Client #19783
Read More
I can't thank you enough for being a great part of my college life. I recommended you to two more of my friends. I am sure they will be making their orders soon. I love the fact that you offer free pages for referrals. I will be referring a few more and maybe I won't have to pay for my next two paper, LOL.