(1) Files and Folders

Author

Steven Bogaerts

Note

Due: Tuesday, September 8

On this page, we’ll talk about files and folders, and get you set up with a basic folder structure and some files you’ll need.

Jungeun Seo made some video walkthroughs for tutorials 1 - 3. You can find them in the Tutorial Videos folder on the Google Drive. You’re not required to watch them, but you may find them helpful in combination with the written instructions. (Note: Any URLs shown in the videos have now changed. Follow the links on this site instead.)

1 Quick Summary

You’re not required to have prior experience in working with files and folders on a computer. We’ll talk about everything step by step on this page. But for this tutorial only, I’ve also provided a quick summary below. If you know what the following means, you can just do it and then skip to tutorial 2. But if you have any doubt, please read the full instructions below.

Important

If you follow these steps and miss a detail, your future programming assignments may not run correctly. If in doubt, read the full guide.

  1. Download & Extract: EECS_183.zip to your local Documents folder.
    • Mac users note: MacOS might never actually show you the .zip file, instead automatically extracting it. That’s fine.
    • Windows users must note: You need to use the local Documents folder, not the OneDrive version that Windows often defaults to. To be certain, open the File Explorer and paste C:\Users\%username%\Documents into the address bar to get to the correct Documents folder, or read the details below.
    • Windows users must note: Do you know the difference between extracting a zip file and just looking inside of it? If not, read the details below.
  2. Visibility: Turn on “File name extensions” in your View settings. See the Windows instructions or the Mac instructions for details if needed.
  3. Shortcut: Create a Desktop shortcut/alias to the EECS_183 folder. Put the shortcut / alias on your desktop. See the Windows instructions or the Mac instructions for details if needed.

Did it work?

If you’re 100% certain you’ve completed the steps above, you can now skip to the next tutorial. If you have any doubts, no problem! Please read the details below.

2 Vocabulary

First, some vocabulary:

  • A file is a basic unit of storage on a computing device, holding related data. For example, you might have a file representing some PowerPoint slides you downloaded for a class lecture, or a PDF file of instructions for an assignment.
  • A folder, also known as a directory, is a container that can hold files, as well as additional folders. We use folders to organize our files so we can easily find them later, and keep related files together and unrelated files separate.

I’ve split this document into Windows and Mac sections. You only need to follow the steps corresponding to your computer.

3 Working with Files in Windows

3.1 Opening the File Explorer

Warning

If you’re using a Mac, skip down to the Mac section below.

If you look at the taskbar at the bottom of your screen, you should see an icon like this: File Explorer icon. Click it to open the File Explorer.

If you don’t see the File Explorer icon icon, then first click the Windows menu (start menu) icon (Windows menu icon) either at the bottom middle or bottom left of your screen. Type “file explorer” and click the File Explorer option that pops up, as shown below. File Explorer in the Windows menu

Upon opening the File Explorer, I see a window as shown below. Your File Explorer may show some different contents, and that’s ok.
Initial File Explorer window

3.2 Getting the Setup Files

A zip file is a special type of file that contains one or more files bundled together in a compressed format. This makes it easier to download and share multiple files at once. We’ll be using a zip file to provide you with some setup files for this course.

Download EECS_183.zip by clicking the link.

Depending on your browser settings, you might be asked where you want to save EECS_183.zip, or it might automatically download to your Downloads folder. If you are asked, save it to your Downloads folder for now (just to keep these instructions consistent).

3.3 Finding the Downloads Folder

  • With the File Explorer window open, click in the address bar at the top middle of the window.

    • This looks similar to where you’d type a website address in a web browser.
    • It probably says “This PC” or “Quick Access” or “Home”.
    • In the image below, it’s the part that says C:\Users\%username%\Downloads.
    • I am not talking about the search box to the right of the address bar, in the upper-right corner.
  • Click in that address bar, delete anything that’s there, and paste the following:

    C:\Users\%username%\Downloads

In Windows, to copy text you must first highlight it by pressing and holding your mouse button while dragging along the text. Then press ctrl+C to copy the highlighted text. To paste text, click where you want to paste it, and then press ctrl+V.

  • That is, it should look like this before you hit enter

    About to get to the downloads folder

  • … and like this after you hit enter:

    Now in the Downloads folder

3.4 Moving a Zip File from Downloads to Documents

You should now see the file in your Downloads folder. The File Explorer should look something like this:

EECS_183.zip file in Downloads folder

Do we want EECS_183.zip to stay in your Downloads folder? No! That would be like getting a package delivered to your doorstep and then keeping the item on your doorstep forever. We need to “bring it inside” and put it in its right place. Let’s move the EECS_183.zip file from your Downloads folder to your Documents folder:

  • Click once (not a double-click) on the EECS_183.zip file in the File Explorer window to make sure that window is the active window.

  • Press ctrl+N to open a new (second) File Explorer window.

  • In the new window, navigate to your Documents folder by clicking in the address bar, deleting anything that’s there, and pasting the following:

    C:\Users\%username%\Documents
  • Hit enter after pasting the text above, and you should then see this:

    File Explorer Documents window

Important

Make sure you find the Documents folder by following the steps above. If you do it in a different way, you might accidentally open the OneDrive version of the Documents folder, which won’t quite work right for this course!

  • Now go back to the first File Explorer window – the one showing your Downloads folder.

  • Right-click on the EECS_183.zip file, and choose Cut:

    Cut the EECS_183.zip

    In Windows, to “right click” with a touchpad, click the touchpad with two fingers instead of just one.

  • Now go to the second File Explorer window (the one showing your Documents folder).

  • Right-click in an empty area of that window, and choose Paste:

    Paste the EECS_183.zip into Documents

    First, make sure you’re clicking in a blank area of your explorer window, not on top of a file or folder.

    If you still don’t see a paste option, you may not have successfully cut the file in the previous step. Go back to the Downloads window, right-click on the EECS_183.zip file again, and choose Cut. Then return to the Documents window and right-click in a blank area to see if the Paste option appears.

    Another step that might help is to close the File Explorer window showing your Documents folder and open it again, again putting C:\Users\%username%\Documents in the address bar (not the search box).

    You should now see the EECS_183.zip file in your Documents folder!

3.5 Unzipping a Zip File

We need to unzip (extract) the contents of the EECS_183.zip file. To do this:

  • Right-click on the EECS_183.zip file in your Documents folder.
Important

Don’t ever bother double-clicking on a zip file. Instead, right-click as instructed here.

You might wonder: Can we just double-click on the zip file to access its contents? The short answer is: no. If you double-click, something different happens. Let me use an analogy:

Suppose you have a box taped shut, with toys inside. If you just pull up the lid a little bit to peek inside, you can see that there are toys in there. Maybe you could even touch one a bit. But you can’t freely play with the toy. To do that, you’d have to peel / cut off the tape, fully open the box, and take the toys out.

This is analogous to double-clicking on a zip versus extracting a zip (via right clicking). When you double click, you’re peeking inside, but you’re limited in what you can do. When you extract a zip, you’re unpacking it and pulling the files out so you can work with them fully. The latter is always what we want.

  • After right clicking on the EECS_183.zip file, in the pop-up menu, choose Extract All...:

    Extract All... option for a zip file

  • A window will pop up:

    Extract Compressed (Zipped) Folders window

  • You don’t need to change any options. Just hit the Extract button at the bottom.

  • Yet another File Explorer window should open up, showing you the contents of the unzipped folder (below). You should see a labs folder, a lecture_notes folder, etc. (Some of the individual files listed below might be slightly different from what you have; that’s ok.)

    Contents of the unzipped EECS_183 folder

You now have access to the contents of the zip file! In particular, you have an EECS_183 folder inside your Documents folder. It has several folders in side to help you organize your files for this course. I’ve also included some “configuration” files that we’ll need soon.

3.6 Setting Up a Shortcut to Your EECS_183 Folder

Let’s make it super easy for you to access your EECS_183 folder in the future. We’ll make a shortcut to it on your desktop.

  • In File Explorer, go to the Documents folder again. Recall that you can do this by pasting the following in the File Explorer address bar:

    C:\Users\%username%\Documents
  • Right-click on your EECS_183 folder (not an empty space, and not the zip file).

  • In the pop-up menu, choose Show more options at the bottom:

    Show more options in Windows

  • Then choose Send to, and then Desktop (create shortcut):

    Send to Desktop (create shortcut) option

  • You should now see a new shortcut created on your desktop:

    The EECS_183 folder shortcut

You can double-click on this shortcut anytime to open your EECS_183 folder.

3.7 Configuring the File Explorer View Options

We also need to tell Windows that we want to see more file information than is shown by default. Open up File Explorer again if you don’t already have it open. Maximize the window by hitting the square icon in the top-right corner of the window, if it’s not already maximized. (Ignore the pop-ups that appear when you hover over the square icon – just click on the square icon itself.) Click on the View drop-down menu in the upper-middle area, choose Show, and make sure you have a check mark next to File name extensions and Hidden items:

View option in File Explorer

If you don’t have a checkbox by those options, you can enable them by clicking on each one. (You’ll have to go through the menu twice, once for each option you check.)

Note

Windows
As a Windows user, you should skip the Mac section below and jump to the next tutorial, Setting Up Python.

4 Working with Files on Mac Computers

Warning

If you’re using Windows, don’t try to complete these Mac-only instructions. After completing the Windows section above, skip to the next tutorial, Setting Up Python.

4.1 Opening the Finder in the Documents Folder

Look at the collection of icons on the bottom of your screen. Locate the one for the Finder: Finder Icon Click it, and you should see something similar to this, though you likely have a lot that will show up under “Recents”:

Finder Recents folder

Click Documents on the left to go to that folder. You should see Documents at the top now:

Finder Documents folder

You may have many items in your Documents folder as well. That’s fine.

4.2 Getting the Setup Files

A zip file is a special type of file that contains one or more files bundled together in a compressed format. This makes it easier to download and share multiple files at once. We’ll be using a zip file to provide you with some setup files for this course.

Download EECS_183.zip by clicking this link.

Once your browser has finished downloading the EECS_183.zip file, it should be in your Downloads folder. Here’s how to find it:

4.3 Finding the Downloads Folder

  • Open the Finder.
  • In the Favorites section on the left, click on Downloads.
  • You should see a new EECS_183 folder in your Downloads folder – with no zipper image on the icon, and no mention of .zip.

If you see EECS_183.zip instead of a folder, that’s perfectly fine. MacOS sometimes automatically extracts zip files, but apparently it hasn’t for you. Here’s how to make it happen:

  • Double-click on the EECS_183.zip file in your Downloads folder.
  • A program called Archive Utility should automatically unzip the file.
  • A new folder (called EECS_183) will appear in the same folder as the zip file.
  • Double-click on the new folder to view its contents.

The EECS_183 folder inside your Downloads folder has several folders inside to help you organize your files for this course. I’ve also included some “configuration” files that we’ll need soon.

4.4 Moving a Folder from Downloads to Documents

Do we want your EECS_183 folder to stay in your Downloads folder? No! That would be like getting a package delivered to your doorstep and then keeping the item on your doorstep forever. We need to “bring it inside” and put it in its right place. Let’s move the the EECS_183 folder from your Downloads folder to your Documents folder:

  • Open two Finder windows: Open the first one as usual. Then click File > New Finder Window to open a second.
  • In one Finder window, navigate to your Downloads folder.
  • In the other, navigate to your Documents folder.
  • In the Downloads window, click on the EECS_183 folder.
  • Make a copy of the folder by pressing +C.
  • Click on the other Finder window (the one with your Documents folder open).
  • We want to paste the folder here and also delete the original. We can do this with a single key combination: ++V.

You should now see the EECS_183 folder in your Documents folder!

4.5 Making an Alias to Your EECS_183 Folder

Let’s make an alias (shortcut) to your EECS_183 folder so you can access it easily from your desktop. Control-click on the EECS_183 folder and choose Make Alias or Create Alias:

Making a Mac alias

It should make a new item named EECS_183 alias, currently in your Documents folder.

Now we need to move that alias to your desktop. Click on the alias once so it is highlighted, then press +C to copy it. Then click on your desktop, and press ++V to cut and paste it there.

From now on, you can double-click on that alias anytime to open your EECS_183 folder.

4.6 Changing the File Listing Style in Finder

Since we’ll be working with a lot of files, I strongly recommend that you change the style in which they are listed. In the Finder, in your EECS_183 folder, click on this icon, located in the top-middle of the Finder window: Finder list icon. You should now see the files in a list, rather than a grid of icons. This will be useful for our work, as it will allow you to see more files at once, and also see more information about each file.

In addition, with the Finder open, go to Finder, Settings (or maybe Preferences), then click Advanced. Select Show all filename extensions so that the box is checked, and then close the Settings window. Now, you’ll be able to see each file’s “type” in the Finder. This will also be useful for our work.