Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 5

3 bytes added, 09:47, 4 September 2017
INVESTIGATION 1: Files
= LAB OBJECTIVES =
:This lab will introduce object oriented programming, using classes to create objects, and reading/writing to files.
 :The first investigation will focus on file management, opening files, saving data to files, and reading files. Since many tasks that system administrators deal with files, this is a crucial skill to understand.The second investigation will cover object oriented programming. Objects are primarily used to store data and code.
== PYTHON REFERENCE ==
:As you develop your Python scripting skills, you may start to be "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 tools. :Below is a table with links to useful online Python reference sites (by category). You may find these references useful when performing assignments, etc.
https://docs.python.org/3/tutorial/errors.html
= INVESTIGATION 1: 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.
== PART 1 - Reading From Files ==
:::4. Before proceeding, make certain that you identify any and all errors in lab5b.py. When the checking script tells you everything is OK before proceeding to the next step.
<br><br>
 
 
 
= INVESTIGATION 2: Exceptions and Error Handling =
13,420
edits