IT 117: Intermediate Scripting
Class 11

Tips and Examples


Review


New Material

Graded Quiz

You can connect to Gradescope to take weekly graded quiz today during the last 15 minutes of the class.

Once you start the quiz you have 15 minutes to finish it.

You can only take this quiz today.

There is not makeup for the weekly quiz because Gradescope does not permit it.

Solution to Homework 4

I have posted a solution to homework 4 here.

Let's take a look.

Homework 6

I have posted homework 6 here.

It is due this coming Sunday at 11:59 PM.

Midterm

The Midterm exam for this course will be held on Tuesday, October 25th.

The exam will be given in this room.

It will consist of questions like those on the quizzes along with questions asking you to write short segments of Python code.

60% of the points on this exam will consist of questions from the Ungraded Class Quizzes.

The other 40% will come from four questions that ask you to write a short segment of code.

The last class before the exam, Thursday, October 20th, will be a review session.

You will only be responsible for the material in the Class Notes for that class on the exam.

You will find the Midterm review Class Notes here.

The Midterm is given on paper.

I scan each exam paper and upload the scans to Gradescope.

I score the exam on Gradescope.

You will get an email from Gradescope with your score when I am done.

The Midterm is a closed book exam.

You are not allowed to any resource other than what is in your head while taking the exam.

Cheating on the exam will result in a score of 0 and will be reported to the Administration.

Remember your Oath of Honesty.

To prevent cheating, certain rules will be enforced during the exam.

Tips and Examples

Making Script Executable

Getting Your First IT Job

Review

Working with the Operating System

The os Module

os.getcwd()

os.listdir(path)

os.chdir(path)

os.rename(old_name, new_name)

os.remove(path)

os.rmdir(path )

os.mkdir(path )

Running Unix Commands within Python

os.environ

The os.path Module

os.path.isfile(path) and os.path.isdir(path)

os.path.basename(path)

The sys Module

Getting Values from the Command Line

Leaving a Running Script

Usage Messages

New Material

Regular Expressions

Working with Regular Expressions

What You Need to Remember

The Characters in Regular Expressions

Ordinary Characters in Regular Expressions

Using Regular Expressions to Find a Match

Pattern Objects

A Test Function for Regular Expressions

Meta-characters in Regular Expressions

The . Meta-character

The * Meta-character

The + Meta-character

The ? Meta-character

The \ Meta-character

Character Classes

\d and \D Character Classes

The \w and \W Character Classes

The \s and \S Character Classes

Attendance

Graded Quiz

Class Exercise

Class Quiz