Group Work: File Basics¶
It is best to use a POGIL approach with the following. In POGIL students work in groups on activities and each member has an assigned role. For more information see https://cspogil.org/Home.
Note
If you work in a group, have only one member of the group fill in the answers on this page. You will be able to share your answers with the group at the bottom of the page.
Learning Objectives
Students will know and be able to do the following.
Content Objectives:
Learn about file path, file name, and file extension.
Learn how to use terminal commands to navigate a file system.
Learn to use the terminal window to execute Python code.
Process Objectives:
Identify a file path, name, and extension.
Use terminal commands to navigate to a desired directory / folder
File Paths, Names, and Extensions¶
A file is saved data in secondary storage on a computer. This type of storage persists even if you turn off power to the computer.
A file has a path, a name, and an extension.
You have probably downloaded a file to your computer (such as TurtleEx1.py
).
On a Apple computer you
can find this file in the Downloads
folder. The path to that file is
/Users/username/Downloads/
. It is the list of parent directories/folders. On a Windows computer the path would
typically be C:\users\your name\downloads\
. One of the things you need
to be aware of when you read and write files is the path to the file.
The file name
is what you have actually called the file. In this case it would be TurtleEx1
.
The file extension is typically three to four characters following a .
after the name.
In this case the extension is py
which means that it is a file with Python code in it.
The txt
extension is used for a plain text file.
/Users/username/Downloads/Test.py
/Users/username/Downloads/Test.py
/Users/username/Downloads/Test.py