Changes

Jump to: navigation, search

OPS435 Assignment 2 for Section C

182 bytes added, 17:35, 3 December 2020
Suggested Process
All your Python codes for this assignment must be placed in a <font color='red'><b><u>single source file</u></b></font>. Please include the following declaration by <b><u>you</u></b> as the <font color='blue'><b>script level docstring</b></font> in your Python source code file (replace [Student_id] with your Seneca email user name, and "Student Name" with your own name):
<source>OPS435 Assignment 2 - Summer Fall 2020Program: a2_[seneca_id]assignment2.py
Author: "Student Name"
The python code in this file a2_[seneca_id]assignment2.py is original work written by
"Student Name". No code in this file is copied from any other source
including any person, textbook, or on-line resource except those provided
<li> Use the invite link posted to Blackboard to accept the assignment, and clone the repo to a Linux machine.
<li> Copy a2_template.py into a2_<myseneca_id>.py. Replace with your Myseneca username.
<li> Run the script itself. Investigate argparse. <b>In the main block, print(args).</b> Experiment with the various options, particularly -v. <li> Read the usage output in the docs, what option must you implement? Go ahead and implement it. Test with print() for now. <b>Commit the change.</b><li> Investigate the `parse_user<code>parse_for_user()` </code> function, with the <code>usage_data_file</code>. This <b>In main, call `parse_for_user()` with `output` as the argument. Investigate what's returned.</b><li> <code>parse_for_user()</code> should take the list of lines from the file, and instead return a list of usernames. <b>In main, print the title header and the output. Commit the change.</b><li> Use argparse with <b>Once you have `output`-l user-> ` parse_for_user()`usage__data_file` --> correct output being printed, use if conditions to call the print only when `parse_user()-l user` function. <b>Commit is in the changecommand line arguments.</b><li> Write a function to print the list from `parse_for_user()`. Now you have input -> processing -> output. <b>Continue committing these changes as your proceed.</b><li> Implement the same things as parse_for_user but for `<code>parse_for_hosts`</code>. Output should be sortedUse the user function to guide you.
<li> Compare your output with the output below.
<li> Write the `parse_for_daily()` function using the pseudocode given. This should be taking the list of lines from your file, and output a dictionary with start dates in DD/MM/YYYY format as the key and usage in seconds as the value.

Navigation menu