IT 117: Intermediate Scripting
Rules for Homework Scripts
If you fail to follow the rules below for homework scripts, you will lose
points.
- All scripts must have the
hashbang
as their first line
#! /usr/bin/python3
- All scripts must have permissions 755
- The filename of all scripts must have a .py extension
- All scripts must have a comment at the top that briefly describes what the
script does
- This comment must follow the hashbang line
- Any import statements must follow the script comment
- All scripts must run on the UMB Unix machines without error
- If a script opens a file, it must do so inside a
try
/except
statement
- All variable names must be a good description of the values they contain
- Whenever input is needed from the keyboard, a meaningful prompt must be used
- All functions must have a comment that describes what the function does
- The comment must be on the line directly above the
function header
with no blank line between them
-
The following class methods do not require comments
unless they are doing something unusual
- Constructors
- Accessors
- Mutators
- Magic Methods
- All function definitions must must appear at the top of the script
- The code in the function body must contain no blank lines
- Each function must have a blank line after it
- The code that runs the functions must appear at the bottom of the script
after all functions have been defined
- There must be a blank line between the last function and the code
that runs the function
- All scripts that take command line arguments must check for the correct number
of arguments, and quit after printing a
usage message
if they do not get the right number of arguments
- For an example of a properly formated script, look
here