CS 111
Fall 2016
Introduction to Computer Science
HW01: Getting to know Unix
Due: Wednesday, 9/14 at 13:50
Go to one of the Math/CS labs (CMC102, 304, or 306) and choose a computer. Many of the Math/CS computers are set up to allow you to boot into either Windows or MacOS; others only boot to MacOS. For this class, you will be using MacOS. If the computer you choose is showing a Mac login screen, go ahead and log in using your usual Carleton user name and password. Otherwise, restart the computer and choose Mac when you're given a choice.
Once you have logged in to your Mac account, work through Typographical Conventions, Introduction to the UNIX Operating System, and Tutorials 1-4 of this Unix tutorial. This tutorial was originally written at the University of Surrey, and has been lightly edited to match what we do at Carleton.
By the end of the tutorial, you should be able to walk comfortably through the following steps:
- Login to your account on a Macintosh (your own or one of the Macs in the CS labs).
- Launch Terminal.
- Create a subdirectory of your home directory to contain your
work for a CS 111 assignment, say
assignment01
. - Change directories to your new directory.
- Launch TextWrangler or some other text editor and create a
simple python program containing:
print('hello', 'world!')
- Save your program as
hello.py
in the new directory. - Back in the Terminal, run your program with the command
python3 hello.py
. - You should see
hello world!
output in the Terminal. - If you use
python
instead ofpython3
, you may see output as('hello', 'world!')
, which is not what we want. Always usepython3
to execute Python 3 code.
Bring questions to class on Wednesday.
Submission
Submit your hello.py
to Moodle.
This is worth 0 points.
The purpose is to test and make sure the submission mechanism is working properly for subsequent assignments.