Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 5

109 bytes removed, 10:34, 4 September 2017
INVESTIGATION 1: Files
:'''NOTE:''' Since many tasks that system administrators deal with files, this is a crucial skill to understand.
<br><br> :Python is an '''object oriented programming language'''. Object oriented programming languages have great advantages or other programming languages. Some advantages include greater modularity for '''more effective troubleshooting''', the ability to '''re-use''' objects, and to provide a '''greater flexibility ''' to allow objects to handle unique situations from various data (for example a date in different formats). The second investigation in this lab will introduce the student to basic object oriented programming. To keep things simple, this investigation will focus more on the concept that objects are primarily used to store data and code.
== PYTHON REFERENCE ==
:As you develop your Python scripting skillsIn previous labs, you may start have been advised to make notes and use online references. This also relates to be working with files and learning about objected oriented programming to help becoming "overwhelmed" with the volume of information that you have absorbed over these labs. One way to help, is to write what you have learned in your labs into your notes. Also, in programming, it is important to use online references in order to obtain information regarding Python scripting techniques and toolsthis lab.
:Below is a table with links to useful online Python reference sites (by category). You may find these references useful when performing assignments, etc.
{| class="wikitable" | style="margin-left:20px; border: 2px solid black;"
|- style="border: 2px solid black;font-weight:bold;text-align:center;"
| style="border: 2px solid black;" | Topic Category
| style="border: 2px solid black;" | Resource Link
|}
= INVESTIGATION 1: Working with Files =
:This first investigation will cover the ability to open text files on the system, read the contents, store the contents, and finally write the contents back into a file. This is a very common practice in programming, used in situations such as logging output, logging errors, reading/creating configuration files, temporary files, and more. Files are accessed through the use of file objects, an object is a storage location which stores data in the form of attributes(variables) and methods(functions). Creating our own objects will be covered in investigation 3.
13,420
edits