Jump to: navigation, search

OPS435 Assignment 2 for Section C

52 bytes added, 17:35, 3 December 2020
Suggested Process
<li> Use the invite link posted to Blackboard to accept the assignment, and clone the repo to a Linux machine.
<li> Copy 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.
<li> Read the usage output in the docs, what option must you implement? Go ahead and implement it. <b>Commit the change.</b>
<li> Investigate the `<code>parse_for_user()` </code> function, with the <code>usage_data_file</code>. **<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.** <b>Commit the change.</b><li> **<b>Once you have `output` --> `parse_for_user()` --> correct output being printed, use if conditions to print only when `-l user` is in the command line arguments.** </code>
<li> <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