Changes

Jump to: navigation, search

OPS435 Assignment 1 for Section C

715 bytes added, 15:05, 1 February 2021
no edit summary
These guidelines are not always possible, but you will be expected to follow these guidelines as much as possible. Break your problem into smaller pieces, and work iteratively to solve each small problem. Test your code after each small change you make, and address errors as soon as they arise. It will make your life easier!
 
== Additional Features ==
 
After completing the above, you are expected to add some additional (two or more) functions providing useful information. Some programs you might want to look at are:
 
* [https://https://ostechnix.com/neofetch-display-linux-systems-information/ screenfetch/neofetch]
* [https://htop.dev/ top/htop/Bashtop]
 
It is expected that the additional features you provided should be useful, non-trivial, they should not require super-user privileges and should not require the installation of additional modules or packages.
<b>In this part of the assignment, it is better to try for something useful and fail than it is to implement something trivial! I am looking for evidence that you have worked with Linux machines and know what kinds of information are useful to see at a glance.</b>
 
You might consider:
* Network information/IP addresses
* The state of some important daemons/systemd services
* process information
* information about online users
* number of packages installed
* cpu load
 
You may even choose to make the output more attractive/colourful etc. If so, you <i>are permitted to use more modules</i> than those specified above, but make sure that the required functions still succeed as they are. You may want to look into default arguments, ask me for clarification if you're interested.
== Coding Standard ==
All your Python code for this assignment must be placed in the provided Python file called <b>assignment1.py</b>. <u>Do not change the name of this file.</u> Please complete the declaration <b><u>as part of the docstring</u></b> in your Python source code file (replace "Student Name" with your own name).
= Submission Guidelines and Process =  == Clone Your Repo (ASAP) ==
The first step will be to clone the Assignment 1 repository. The invite link will be provided to you by your professor. The repo will contain a check script, a README file, and the file where you will enter your code.
For the first milestone you will have two functions to complete.
* <code>call_du_sub</code> will take one argument and return a list. The argument is a target directory. The function will use <code>subprocess.Popen</code> to run the command <b>du -d l <target_directory></b>.
* <code>percent_to_graph</code> will take two arguments and return a string.  In order to complete <code>percent_to_graph()</code>, it's helpful to know the equation for converting a number from one scale to another. (''y''<sub>out</sub> - ''y''<sub>min</sub>) / (''y''<sub>max</sub> - ''y''<sub>min</sub>) = (''x''<sub>in</sub> - ''x''<sub>min</sub>) / (''x''<sub>max</sub> - ''x''<sub>min</sub>) In this equation, ``x`` refers to your input value percent and ``y`` will refer to the number of symbols to print. The max of percent is 100 and the min of percent is 0.Be sure that you are rounding to an integer, and then print that number of symbols to represent the percentage. The number of spaces that you print will be the inverse. Test your functions with the Python interpreter. Use <code>import duimpython3</code>, then call functions with test arguments: import duim duim.percent_to_graph(50, 10)
== Second Milestone (due February 21) ==
For the second milestone you will have two more functions to complete.
* <code>create_dir_dict</code> will take your list from <code>call_du_sub</code> and return a dictionary.
* <code>get_total</code> will take two arguments: your list from <code>call_du_sub</code> and the target directory. It will return an integer that is the size of the target directory. == Additional Features == After completing the above, you are expected to add some additional (two or more) functions providing useful information. Some programs you might want to look at are: * [https://https://ostechnix.com/neofetch-display-linux-systems-information/ screenfetch/neofetch]* [https://htop.dev/ top/htop/Bashtop] It is expected that the additional features you provided should be useful, non-trivial, they should not require super-user privileges and should not require the installation of additional modules or packages.<b>In this part of the assignment, it is better to try for something useful and fail than it is to implement something trivial! I am looking for evidence that you have worked with Linux machines and know what kinds of information are useful to see at a glance.</b> You might consider:* Network information/IP addresses* The state of some important daemons/systemd services* process information* information about online users* number of packages installed* cpu load You may even choose to make the output more attractive/colourful etc. If so, you <i>are permitted to use more modules</i> than those specified above, but make sure that the required functions still succeed as they are. You may want to look into default arguments, ask me for clarification if you're interested.
== The Assignment (due March 7, 11:59pm) ==

Navigation menu