Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
CSci 127: Introduction to Computer Science
hunter.cuny.edu/csci
CSci 127 (Hunter) Lecture 10 21 April 2020 1 / 33
Announcements
Please always read all Blackboardannouncements
Online help is available in multiple forms whenschool is in session:
I Email: [email protected] Discussion Board: on Blackboard, link
on purple menu barI Drop-in tutoring (12pm-5pm):
sign in here:https://bit.ly/csci127Tutoringthen join the session here:https://bit.ly/csci127TutoringSession
CSci 127 (Hunter) Lecture 10 21 April 2020 2 / 33
Announcements
Please always read all Blackboardannouncements
Online help is available in multiple forms whenschool is in session:
I Email: [email protected] Discussion Board: on Blackboard, link
on purple menu barI Drop-in tutoring (12pm-5pm):
sign in here:https://bit.ly/csci127Tutoringthen join the session here:https://bit.ly/csci127TutoringSession
CSci 127 (Hunter) Lecture 10 21 April 2020 2 / 33
Announcements
Please always read all Blackboardannouncements
Online help is available in multiple forms whenschool is in session:
I Email: [email protected]
I Discussion Board: on Blackboard, linkon purple menu bar
I Drop-in tutoring (12pm-5pm):sign in here:https://bit.ly/csci127Tutoringthen join the session here:https://bit.ly/csci127TutoringSession
CSci 127 (Hunter) Lecture 10 21 April 2020 2 / 33
Announcements
Please always read all Blackboardannouncements
Online help is available in multiple forms whenschool is in session:
I Email: [email protected] Discussion Board: on Blackboard, link
on purple menu bar
I Drop-in tutoring (12pm-5pm):sign in here:https://bit.ly/csci127Tutoringthen join the session here:https://bit.ly/csci127TutoringSession
CSci 127 (Hunter) Lecture 10 21 April 2020 2 / 33
Announcements
Please always read all Blackboardannouncements
Online help is available in multiple forms whenschool is in session:
I Email: [email protected] Discussion Board: on Blackboard, link
on purple menu barI Drop-in tutoring (12pm-5pm):
sign in here:https://bit.ly/csci127Tutoringthen join the session here:https://bit.ly/csci127TutoringSession
CSci 127 (Hunter) Lecture 10 21 April 2020 2 / 33
Announcements
Please always read all Blackboardannouncements
Online help is available in multiple forms whenschool is in session:
I Email: [email protected] Discussion Board: on Blackboard, link
on purple menu barI Drop-in tutoring (12pm-5pm):
sign in here:https://bit.ly/csci127Tutoringthen join the session here:https://bit.ly/csci127TutoringSession
CSci 127 (Hunter) Lecture 10 21 April 2020 2 / 33
Today’s Topics
Recap: Folium
Indefinite loops
Design Patterns: Max (Min)
Design Challenge
CSci 127 (Hunter) Lecture 10 21 April 2020 3 / 33
Today’s Topics
Recap: Folium
Indefinite loops
Design Patterns: Max (Min)
Design Challenge
CSci 127 (Hunter) Lecture 10 21 April 2020 4 / 33
Challenge:What does this code do?
CSci 127 (Hunter) Lecture 10 21 April 2020 5 / 33
Folium example
What does this code do?
CSci 127 (Hunter) Lecture 10 21 April 2020 6 / 33
Folium example
What does this code do?
CSci 127 (Hunter) Lecture 10 21 April 2020 6 / 33
Folium
A module for making HTML maps.
It’s a Python interface to the popularleaflet.js.
Outputs .html files which you can open in abrowser.
An extra step:
Write ! Run ! Open .html
code. program. in browser.
CSci 127 (Hunter) Lecture 10 21 April 2020 7 / 33
Folium
A module for making HTML maps.
It’s a Python interface to the popularleaflet.js.
Outputs .html files which you can open in abrowser.
An extra step:
Write ! Run ! Open .html
code. program. in browser.
CSci 127 (Hunter) Lecture 10 21 April 2020 7 / 33
Folium
A module for making HTML maps.
It’s a Python interface to the popularleaflet.js.
Outputs .html files which you can open in abrowser.
An extra step:
Write ! Run ! Open .html
code. program. in browser.
CSci 127 (Hunter) Lecture 10 21 April 2020 7 / 33
Folium
A module for making HTML maps.
It’s a Python interface to the popularleaflet.js.
Outputs .html files which you can open in abrowser.
An extra step:
Write ! Run ! Open .html
code. program. in browser.
CSci 127 (Hunter) Lecture 10 21 April 2020 7 / 33
Folium
A module for making HTML maps.
It’s a Python interface to the popularleaflet.js.
Outputs .html files which you can open in abrowser.
An extra step:
Write ! Run ! Open .html
code. program. in browser.
CSci 127 (Hunter) Lecture 10 21 April 2020 7 / 33
Today’s Topics
Recap: Folium
Indefinite loops
Design Patterns: Max (Min)
Design Challenge
CSci 127 (Hunter) Lecture 10 21 April 2020 8 / 33
Challenge:
Write a function that asks a user for number after 2000 but before2018. The function should repeatedly ask the user for a number untilthey enter one within the range and return the number.
CSci 127 (Hunter) Lecture 10 21 April 2020 9 / 33
CodingWrite a function that asks a user for number after 2000 but before2018. The function should repeatedly ask the user for a number untilthey enter one within the range and return the number..
CSci 127 (Hunter) Lecture 10 21 April 2020 10 / 33
CodingWrite a function that asks a user for number after 2000 but before2018. The function should repeatedly ask the user for a number untilthey enter one within the range and return the number.
def getYear():
CSci 127 (Hunter) Lecture 10 21 April 2020 11 / 33
CodingWrite a function that asks a user for number after 2000 but before2018. The function should repeatedly ask the user for a number untilthey enter one within the range and return the number.
def getYear():
return(num)
CSci 127 (Hunter) Lecture 10 21 April 2020 12 / 33
CodingWrite a function that asks a user for number after 2000 but before2018. The function should repeatedly ask the user for a number untilthey enter one within the range and return the number.
def getYear():
num = 0
return(num)
CSci 127 (Hunter) Lecture 10 21 April 2020 13 / 33
CodingWrite a function that asks a user for number after 2000 but before2018. The function should repeatedly ask the user for a number untilthey enter one within the range and return the number.
def getYear():
num = 0
while num <= 2000 or num >= 2018:
return(num)
CSci 127 (Hunter) Lecture 10 21 April 2020 14 / 33
CodingWrite a function that asks a user for number after 2000 but before2018. The function should repeatedly ask the user for a number untilthey enter one within the range and return the number.
def getYear():
num = 0
while num <= 2000 or num >= 2018:
num = int(input(’Enter a number > 2000 & < 2018’))
return(num)
CSci 127 (Hunter) Lecture 10 21 April 2020 15 / 33
Indefinite Loops
Indefinite loops repeat as long asthe condition is true.
Could execute the body of theloop zero times, 10 times, infinitenumber of times.
The condition determines howmany times.
Very useful for checking input,simulations, and games.
CSci 127 (Hunter) Lecture 10 21 April 2020 16 / 33
Indefinite Loops
Indefinite loops repeat as long asthe condition is true.
Could execute the body of theloop zero times, 10 times, infinitenumber of times.
The condition determines howmany times.
Very useful for checking input,simulations, and games.
CSci 127 (Hunter) Lecture 10 21 April 2020 16 / 33
Indefinite Loops
Indefinite loops repeat as long asthe condition is true.
Could execute the body of theloop zero times, 10 times, infinitenumber of times.
The condition determines howmany times.
Very useful for checking input,simulations, and games.
CSci 127 (Hunter) Lecture 10 21 April 2020 16 / 33
Indefinite Loops
Indefinite loops repeat as long asthe condition is true.
Could execute the body of theloop zero times, 10 times, infinitenumber of times.
The condition determines howmany times.
Very useful for checking input,simulations, and games.
CSci 127 (Hunter) Lecture 10 21 April 2020 16 / 33
Indefinite Loops
Indefinite loops repeat as long asthe condition is true.
Could execute the body of theloop zero times, 10 times, infinitenumber of times.
The condition determines howmany times.
Very useful for checking input,simulations, and games.
CSci 127 (Hunter) Lecture 10 21 April 2020 16 / 33
Indefinite Loops
CSci 127 (Hunter) Lecture 10 21 April 2020 17 / 33
Indefinite Loops
CSci 127 (Hunter) Lecture 10 21 April 2020 17 / 33
ChallengePredict what this code does:
CSci 127 (Hunter) Lecture 10 21 April 2020 18 / 33
Trinket Demo
(Demo with trinket)
CSci 127 (Hunter) Lecture 10 21 April 2020 19 / 33
Today’s Topics
Recap: Folium
Indefinite loops
Design Patterns: Max (Min)
Design Challenge
CSci 127 (Hunter) Lecture 10 21 April 2020 20 / 33
Design Patterns
A design pattern is a standard algorithmor approach for solving a commonproblem.
The pattern is independent of theprogramming language.
Can think of as a master recipe, withvariations for di↵erent situations.
CSci 127 (Hunter) Lecture 10 21 April 2020 21 / 33
Design Patterns
A design pattern is a standard algorithmor approach for solving a commonproblem.
The pattern is independent of theprogramming language.
Can think of as a master recipe, withvariations for di↵erent situations.
CSci 127 (Hunter) Lecture 10 21 April 2020 21 / 33
Design Patterns
A design pattern is a standard algorithmor approach for solving a commonproblem.
The pattern is independent of theprogramming language.
Can think of as a master recipe, withvariations for di↵erent situations.
CSci 127 (Hunter) Lecture 10 21 April 2020 21 / 33
Challenge:
Predict what the code will do:
CSci 127 (Hunter) Lecture 10 21 April 2020 22 / 33
Python Tutor
(Demo with pythonTutor)
CSci 127 (Hunter) Lecture 10 21 April 2020 23 / 33
Max Design Pattern
Set a variable to the smallest value.
Loop through the list,
If the current number is larger,update your variable.
Print/return the largest number found.
Similar idea works for finding theminimum value.
CSci 127 (Hunter) Lecture 10 21 April 2020 24 / 33
Max Design Pattern
Set a variable to the smallest value.
Loop through the list,
If the current number is larger,update your variable.
Print/return the largest number found.
Similar idea works for finding theminimum value.
CSci 127 (Hunter) Lecture 10 21 April 2020 24 / 33
Max Design Pattern
Set a variable to the smallest value.
Loop through the list,
If the current number is larger,update your variable.
Print/return the largest number found.
Similar idea works for finding theminimum value.
CSci 127 (Hunter) Lecture 10 21 April 2020 24 / 33
Max Design Pattern
Set a variable to the smallest value.
Loop through the list,
If the current number is larger,update your variable.
Print/return the largest number found.
Similar idea works for finding theminimum value.
CSci 127 (Hunter) Lecture 10 21 April 2020 24 / 33
Max Design Pattern
Set a variable to the smallest value.
Loop through the list,
If the current number is larger,update your variable.
Print/return the largest number found.
Similar idea works for finding theminimum value.
CSci 127 (Hunter) Lecture 10 21 April 2020 24 / 33
Pandas: Minimum Values
In Pandas, lovely built-in functions:
I df.sort values(’First Name’) andI df[’First Name’].min()
What if you don’t have a CSV and DataFrame, or data not ordered?
CSci 127 (Hunter) Lecture 10 21 April 2020 25 / 33
Pandas: Minimum Values
In Pandas, lovely built-in functions:I df.sort values(’First Name’) andI df[’First Name’].min()
What if you don’t have a CSV and DataFrame, or data not ordered?
CSci 127 (Hunter) Lecture 10 21 April 2020 25 / 33
Pandas: Minimum Values
In Pandas, lovely built-in functions:I df.sort values(’First Name’) andI df[’First Name’].min()
What if you don’t have a CSV and DataFrame, or data not ordered?
CSci 127 (Hunter) Lecture 10 21 April 2020 25 / 33
Design Question: Find first alphabetically
What if you don’t have a CSV and DataFrame, or data not ordered?
Useful Design Pattern: min/maxI Set a variable to worst value (i.e. maxN = 0 or first = "ZZ").I For each item, X, in the list:
F Compare X to your variable.
F If better, update your variable to be X.
I Print/return X.
CSci 127 (Hunter) Lecture 10 21 April 2020 26 / 33
Design Question: Find first alphabetically
What if you don’t have a CSV and DataFrame, or data not ordered?
Useful Design Pattern: min/max
I Set a variable to worst value (i.e. maxN = 0 or first = "ZZ").I For each item, X, in the list:
F Compare X to your variable.
F If better, update your variable to be X.
I Print/return X.
CSci 127 (Hunter) Lecture 10 21 April 2020 26 / 33
Design Question: Find first alphabetically
What if you don’t have a CSV and DataFrame, or data not ordered?
Useful Design Pattern: min/maxI Set a variable to worst value (i.e. maxN = 0 or first = "ZZ").
I For each item, X, in the list:F Compare X to your variable.
F If better, update your variable to be X.
I Print/return X.
CSci 127 (Hunter) Lecture 10 21 April 2020 26 / 33
Design Question: Find first alphabetically
What if you don’t have a CSV and DataFrame, or data not ordered?
Useful Design Pattern: min/maxI Set a variable to worst value (i.e. maxN = 0 or first = "ZZ").I For each item, X, in the list:
F Compare X to your variable.
F If better, update your variable to be X.
I Print/return X.
CSci 127 (Hunter) Lecture 10 21 April 2020 26 / 33
Design Question: Find first alphabetically
What if you don’t have a CSV and DataFrame, or data not ordered?
Useful Design Pattern: min/maxI Set a variable to worst value (i.e. maxN = 0 or first = "ZZ").I For each item, X, in the list:
F Compare X to your variable.
F If better, update your variable to be X.
I Print/return X.
CSci 127 (Hunter) Lecture 10 21 April 2020 26 / 33
Design Question: Find first alphabetically
What if you don’t have a CSV and DataFrame, or data not ordered?
Useful Design Pattern: min/maxI Set a variable to worst value (i.e. maxN = 0 or first = "ZZ").I For each item, X, in the list:
F Compare X to your variable.
F If better, update your variable to be X.
I Print/return X.
CSci 127 (Hunter) Lecture 10 21 April 2020 26 / 33
Design Question: Find first alphabetically
What if you don’t have a CSV and DataFrame, or data not ordered?
Useful Design Pattern: min/maxI Set a variable to worst value (i.e. maxN = 0 or first = "ZZ").I For each item, X, in the list:
F Compare X to your variable.
F If better, update your variable to be X.
I Print/return X.
CSci 127 (Hunter) Lecture 10 21 April 2020 26 / 33
Today’s Topics
Recap: Folium
Indefinite loops
Design Patterns: Max (Min)
Design Challenge
CSci 127 (Hunter) Lecture 10 21 April 2020 27 / 33
Design Challenge
Collect all five stars (locations randomly generated):
CSci 127 (Hunter) Lecture 10 21 April 2020 28 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, or
I Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.
I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.
I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.
I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Design Challenge
Possible approaches:
I Randomly wander until all 5 collected, orI Start in one corner, and systematically visit every point.
Input: The map of the ‘world.’
Output: Time taken and/or locations of the 5 stars.
How to store locations? Use numpy array with -1 everywhere.
Possible algorithms: while numStars < 5:
I Move forward.I If wall, mark 0 in map, randomly turn left or right.I If star, mark 1 in map and add 1 to numStars.I Otherwise, mark 2 in map that it’s an empty square.
CSci 127 (Hunter) Lecture 10 21 April 2020 29 / 33
Recap
Quick recap of a Python library, Folium for
creating interactive HTML maps.
More details on while loops for repeating
commands for an indefinite number of times.
Introduced the max design pattern.
CSci 127 (Hunter) Lecture 10 21 April 2020 30 / 33
Recap
Quick recap of a Python library, Folium for
creating interactive HTML maps.
More details on while loops for repeating
commands for an indefinite number of times.
Introduced the max design pattern.
CSci 127 (Hunter) Lecture 10 21 April 2020 30 / 33
Recap
Quick recap of a Python library, Folium for
creating interactive HTML maps.
More details on while loops for repeating
commands for an indefinite number of times.
Introduced the max design pattern.
CSci 127 (Hunter) Lecture 10 21 April 2020 30 / 33
Final Exam Prep: UNIX
xkcd 149
This course has three main themes:I Programming & Problem Solving
I Organization of Hardware & DataI Design
The operating system, Unix, is part ofthe second theme.
Unix commands in the weekly on-linelabs
CSci 127 (Hunter) Lecture 10 21 April 2020 31 / 33
Final Exam Prep: UNIX
xkcd 149
This course has three main themes:I Programming & Problem SolvingI Organization of Hardware & Data
I Design
The operating system, Unix, is part ofthe second theme.
Unix commands in the weekly on-linelabs
CSci 127 (Hunter) Lecture 10 21 April 2020 31 / 33
Final Exam Prep: UNIX
xkcd 149
This course has three main themes:I Programming & Problem SolvingI Organization of Hardware & DataI Design
The operating system, Unix, is part ofthe second theme.
Unix commands in the weekly on-linelabs
CSci 127 (Hunter) Lecture 10 21 April 2020 31 / 33
Final Exam Prep: UNIX
xkcd 149
This course has three main themes:I Programming & Problem SolvingI Organization of Hardware & DataI Design
The operating system, Unix, is part ofthe second theme.
Unix commands in the weekly on-linelabs
CSci 127 (Hunter) Lecture 10 21 April 2020 31 / 33
Final Exam Prep: UNIX
xkcd 149
This course has three main themes:I Programming & Problem SolvingI Organization of Hardware & DataI Design
The operating system, Unix, is part ofthe second theme.
Unix commands in the weekly on-linelabs
CSci 127 (Hunter) Lecture 10 21 April 2020 31 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Final Exam Prep: UNIX
xkcd 149
Unix commands in the weekly on-line labs:
Lab 2: pwd, ls, mkdir, cd
Lab 3: ls -l, cp, mv
Lab 4: cd ../ (relative paths)
Lab 5: cd /usr/bin (absolute paths), cd ⇠
Lab 6: Scripts, chmod
Lab 7: Running Python from the command line
Lab 8: git from the command line
Lab 9: ls *.py (wildcards)
Lab 10: More on scripts, vim
Lab 11: ls | wc -c (pipes), grep, wc
Lab 12: file, which
Lab 13: man, more, w
CSci 127 (Hunter) Lecture 10 21 April 2020 32 / 33
Educational Psychology Study
If you have consented to participate in the
Educational Psychology study,
please fill in the 3-question survey
Clickable link also below the video.
Thank you for your participation!!!
CSci 127 (Hunter) Lecture 10 21 April 2020 33 / 33