csc1015f_2023_orientation_manual (3)
csc1015f_2023_orientation_manual (3)
Table of Contents
1. INTRODUCTION ...................................................................................................................................... 2
2. ACCESSING AMATHUBA .......................................................................................................................... 2
2.1. ACADEMIC DISHONESTY FOR COMPUTER PROGRAM SUBMISSIONS POLICY ...................................................................3
3. FILES AND FOLDERS ................................................................................................................................ 4
3.1 SETTING UP ONEDRIVE ........................................................................................................................................5
3.1.A Windows 10............................................................................................................................................8
3.1.B Other Windows PC .................................................................................................................................9
3.1.C Apple Mac...............................................................................................................................................9
3.2 FOLDERS FOR YOUR PROGRAMS. ............................................................................................................................9
4. PYTHON 3 AND WING IDE 101............................................................................................................... 10
4.1 INSTALLING PYTHON ..........................................................................................................................................11
4.2 INSTALLING WING 101 ......................................................................................................................................13
4.3 STARTING (AND CONFIGURING) WING 101............................................................................................................17
5. WRITING A PYTHON PROGRAM IN WING 101 ........................................................................................ 19
6. CREATING A ZIP FILE ............................................................................................................................. 24
7. SUBMISSION OF ASSIGNMENT .............................................................................................................. 27
7.1 THE AUTOMATIC MARKER ERRORS CHECKLIST .......................................................................................................29
7.1.1 Incorrect naming of files .......................................................................................................................30
7.1.2 Compressing a folder instead of a file ..................................................................................................30
7.1.3 Submitting a Program with Syntax Errors ............................................................................................31
7.1.4 Submitting an uncompressed file to the Automatic Marker ................................................................32
8. EDITING AN EXISTING PROGRAM .......................................................................................................... 34
9. PYTHON DOCUMENTATION .................................................................................................................. 34
Page 1/34
1. Introduction
This is a self-paced tutorial on the procedure for setting up your computer in order to complete
Computer Science 1015F/1017F/1019F practical assignments and submit them online using the
Amathuba learning management system.
It is recommended that you follow the tutorial in sequence from beginning to end. However, do feel
free to deviate from the procedure to explore the functions available but try not to get lost – if
necessary, ask for assistance from a tutor or one of your peers (assuming they are not lost as well ☺).
NOTE: We have tried to cover the steps for PC and for Mac, however, at the time of writing, only
Windows 10 was available, so screen snapshots are of this. We have Windows 11 in the Scilabs now.
However, the steps are quite similar.
The tutorial is organised as follows:
Section Content
2 Accessing the Amathuba course site and accepting the Academic Dishonesty for Computer
Program Submissions Policy.
3 Configuring cloud storage and organising folders for your programs.
4 Installing Python 3 and Wing 101 IDE.
5. Writing and running a first Python program in Wing.
6. Creating a ZIP archive file.
7. Submitting an assignment to the automatic marker.
8. Editing an existing Python program.
9. Python Documentation.
2. Accessing Amathuba
The first thing you will do is log on to Amathuba. The UCT course management system.
Execute a Web browser application such as Google Chrome.
Enter a URL of https://amathuba.uct.ac.za/ to go to the Amathuba website. Click on UCT Login and if
the Web browser pops up a box asking you for a password, this is UCT's system to control access to
the outside Internet – simply enter your user ID and password as before and click Ok. NB: your user ID
is your UCT student number.
Page 2/34
Enter your username and password on the Amathuba website and you will be able to log in. Then click
on the tab on the left under “My Courses” that corresponds to the class you are in, and you will arrive
at the front page of the website for that class.
Page 3/34
The entry first is the subject of this section which will be found under Assignments. Click on
Assignment 1: Orientation and Academic Dishonesty for Computer Program Submissions Policy
Acceptance:
Follow the instructions: read the attached policy (click on the link to the PDF document
csc_2023_AcademicDishonestyPolicy.pdf); accept by typing your name, student number and current
date into the ‘Assignment Text’ text box, and click Submit.
Page 4/34
UCT students are provided with 1 terabyte of secure cloud storage space on Microsoft OneDrive. We
explain how to set up access to this service, then we suggest a folder structure for organising your
work.
You may familiar with OneDrive, or similar service such as Google Drive or Drop Box. They all work in
the same way. On your computer you have a special folder, the contents of which are duplicated in
the cloud.
You are able to create and work with files in this folder knowing that any changes are backed up. You
will also be able to access those files from anywhere and with any device – such as your phone or
tablet. Any changes you make to files or the contents of the folder on one device will be duplicated
across all your devices.
You can also work directly with the cloud copies of files using suitable Web apps.
Enter your [email protected], i.e. an email address composed of your student number and
“@wf.uct.ac.za”. Click ‘next’. Now you will be asked to enter your UCT password:
Page 5/34
Click ‘Sign in’, and you will see the Microsoft Office web portal. (Your view will be much less cluttered
than the following screenshot.)
Here you have access to the online versions of the Microsoft Office apps - the app icons are a column
at the left-hand side of the page. The OneDrive app is the blue cloud icon.
Click on it to see your file storage space. (Which, again, will almost certainly be less cluttered than the
following example!)
Page 6/34
You will see from the menu items at the top of the page that you can create files and upload files
among other things. However, what we want to do is set up the OneDrive app so that you can create
and edit files on your computer as you usually do but have them be transparently backed up to this
online storage space. (For each file you will have a ‘local’ copy, i.e. on your computer, and a ‘cloud’
copy.)
Click on ‘Get the OneDrive apps’ at the bottom of the left-hand panel.
Page 7/34
The next step(s) depend on whether you are using Windows or a Mac.1
3.1.A Windows 10
OneDrive comes preinstalled on Windows 10 computers. If you are using such a computer click ‘Start
OneDrive’.
A new browser tab will open and a pop-up will appear. Click ‘Open Microsoft OneDrive’.
Sign in with your [email protected] and UCT password. Once set up is complete, a File
Explorer window will open.
1 Details extracted from the ICTS document “Move your data from your F: drive to OneDrive for Business”.
Page 8/34
You will see in the left-hand column there is a ‘OneDrive – University of Cape Town’ option, and in the
right-hand pane, the files in this new folder are displayed.
3.1.B Other Windows PC
Click ‘Download’. The file ‘OneDriveSetup.exe’ is saved in your downloads folder. Right-click on the file
and select ‘Run as Administrator’. Once the installation is complete, a cloud icon appears in the
taskbar. Click the cloud icon and sign in with your [email protected] and UCT password.
When you open File Explorer (by pressing, say Windows key and ‘E’, or by clicking on the Folder icon
on the task bar), you will see that there is a OneDrive – University of Cape Town option in the left-hand
column. Click on it, and the files in this folder will be displayed in the right-hand pane.
If you receive this, enter your Mac password and click ‘Allow’ or ‘Always Allow’ to update your
keychain. Click ‘next’ to complete setup.
You can now access your OneDrive for Business folder.
Page 9/34
Open your ‘OneDrive – University of Cape Town’ folder and create a new folder. Give it the name
csc1015f_practical_assignments or csc1017f_practical_assignments or whatever is suitable for your
course.
Now double-click on the folder that you have created. You will be able to see the list of files it
contains.
As you can expect, the folder is empty as we have just created it! Using the same procedure, create a
folder here called orientation.
Double-click to change to this folder.
Page 10/34
4.1 Installing Python
Select the ‘Python’ folder. You will see sub folders for Mac and Windows, and a note for Linux Users.
Click on the appropriate folder and then click on the installer file that it contains.
Page 11/34
Once the installer file is downloaded, if it does not run automatically, open your downloads folder
and run it from there (by double clicking).
Page 12/34
Here is what you should see for a Windows installation:
Note: This installer is for an earlier version of Python. A newer version can be downloaded from the
Amathuba site of the course.
Click ‘Install Now’. You will be asked if you wish to allow the app to install (the language varies de-
pending in whether you are using a Mac or PC.) You should say ‘yes’.
You will see a similar sequence on a Mac: licence agreement, select where to put the files, enter
your Mac username and password to authorise. Click ‘Close’ when it is done.
Page 13/34
Select Wing IDE 101 and again, open the folder for your computer and download the file it contains.
NOTE: The folder for Linux contains 3 files: one for Debian, one for Red Hat, and one generic
compressed tar file.
Once the installer file is downloaded, if it does not run automatically, open your downloads folder,
and run it from there (by double clicking). You will be asked if you wish to allow the app to run, you
should say ‘yes’.
The file for Apple Mac is a ‘distributed disk image’. It will create a ‘virtual disk drive’/folder on your
desktop. Open it and drag the contents to the Applications folder, and from there to the task bar, if
you want quick access in future.
Page 14/34
The Windows installer has several dialogue windows.
Click ‘Next’ and accept the licence agreement and click ‘Next’ again. If you are asked where to install,
accept the default location and click ‘Next’. You may also be invited to create a desktop shortcut,
click ‘Next’. Finally, click ‘Install’!
Page 15/34
Page 16/34
4.3 Starting (and configuring) Wing 101
When you run Wing 101 for the first time, you will be asked to accept the licence agreement.
As WING IDE eventually starts up, it temporarily displays a splash-screen, which provides some
information about the application as it is loaded into the computer’s memory.
Note: the Wing 101 screenshots below were captured using version 8 of the IDE. Please download
the most recent version from Amathuba. You should be able to find version 9 on Amathuba.
As this is the first time you are running Wing, a quick start guide will appear as the main window.
Page 17/34
Wing automatically detects and selects an installed version of the Python Interpreter. You will be
able to see which it has picked by scrutinising the text in the bottom panel. It should say ‘Python
3.9.2 …’.
It is possible that it does not because you had another version installed before. Mac OS X, in fact,
definitely does have another version – it comes with a default installation of Python 2 - and it’s
possible that Wing picks this up.
To configure the right version of Python, click on the Edit menu then ‘Configure Python’.
Page 18/34
On Windows, click the down arrow to the left of Browse and you will see a list of the Python
installations on the computer.
Select the line with ‘Python39’ contained within it and then click ‘Okay’.
On Mac, first open a Terminal (press Command-Space bar and type ‘Terminal’ then select from
search results. In the terminal window, type ‘which python3’. Copy the result to the text box in the
Wing Python Configuration window and click ‘Okay’.
Wing will invite you to restart.
Click ‘Restart’ and when the Wing main window reopens, check the details in the bottom pane again.
Page 19/34
The WING IDE has 2 major panes (sections of a window) at start-up. At the top are buttons and a
menu to activate various functions of the IDE. The main section is an empty canvas where editing of
files will take place. The bottom pane contains a number of tabs. The “Python Shell” tab is where
Python input and output will take place.
(You might also see the “Search” tab open beside the “Python Shell” tab. This provides a search and
replace option to help in editing – we will not use this right now.)
The first step is to create a new file to store your program. You will usually do this as the first step of
the solution to each part of a programming assignment. Click on File on the menu, then New. A new
blank window will appear to take up the empty space.
Page 20/34
The first thing you want to do is save the file – even though you have not typed in anything yet, this
will provide a name for the program. Click on the Save button (the blue icon shaped like an old 3.5”
floppy disk) or choose Save from the File menu.
You will now be presented with a dialog box where you can choose the directory to save the file in
and you can enter a filename e.g. on windows:
Now, remember that you created a folder called orientation within a folder called
csc1015f_practical_assignments within your OneDrive – University of Cape Town. This is where you
will save your file.
On Windows, to find your OneDrive folder, click on Desktop:
Page 21/34
We usually write programs and store them in multiple files. There are many reasons for this, including
that large files are difficult to manage. For most of your assignments, however, there will only be a
single file for each question. You can open all files simultaneously if you wish, or work on one at a
time.
You should now be back at the main IDE workspace and the filename in the tab top will have changed
to hello.py. Note that the title bar of the window also indicates the name and location of the file.
Page 22/34
Click anywhere on the white portion of the top pane to make sure your cursor is in the right place and
then type in the following program exactly as it appears, but inserting your name, student number
and date where specified:
This small program simply prints out the words Hello World to the screen. It is classically the first
program most people learn to write when learning a new programming language.
As you typed the program in, WING IDE highlighted the words in different colours. This syntax
highlighting helps programmers to understand their code more easily. The green lines are comments
that are not instructions to the computer but help any readers of the program understand what it
does, who wrote it, when it was written, etc. Comments are absolutely critical and all your
programming assignments MUST contain appropriate comments – this will be elaborated upon
further by your lecturers.
The blue words are reserved words that have special meaning in Python so cannot be used by the
programmer in any other way. Anything within quotation marks is purple and the rest is black.
Now that we have entered the program, the FIRST thing we ALWAYS do is save the file. This transfers
the program from the computer’s memory to the computer’s hard drive, where it is stored
permanently. Without saving, if there is a power failure (for which Cape Town used to be infamous!),
any changes made in the IDE will be lost! For longer programs, we save the file much more often – not
just after writing the whole program. You also MUST save the file every time you modify it – your IDE
may try to help by reminding you if you forget but don’t rely on that.
Click on the Save button (or click) File and then Save.
WING IDE saves the file – it does not ask you where to put it because it already knows the filename
(which is hello.py in this case).
We can now execute the program on the machine. WING IDE starts the Python interpreter and gets it
to execute your program. The input and output from this process can be seen in the bottom pane.
Page 23/34
If there are errors in your program, it means that the interpreter could not understand the language
used by the programmer – the programmer probably made an error. If you get error messages you
need to correct the error(s) in your program before proceeding.
Click on the Run icon in the menu to run or execute the program.
The Python Shell in the bottom pane will show the output from your program. If you see the words
Hello World, your program has executed successfully.
Page 24/34
But there may be a small problem. In WING IDE we created a file called hello.py but the folder may
display something called hello. The filename hello.py has an extension of py. These are the letters
after the period and usually indicate what the purpose of the file is. Windows 10 and Mac OS X take
some liberties and tries to make folders more graphical by removing the old-style extensions and
replacing them with little icons e.g., the logo to the left of hello. For normal computer users, this is
fine. Programmers, however, need a bit more control so we need to see the extensions.
Luckily, we can tell Windows and Mac OS not to hide the extensions.
On Windows, click on the View tab (at the top of the window, just below the title), and then select the
tick box labelled ‘File name extensions’. The folder now displays the complete filenames for all files.
On Mac OS 10, select the Finder/Folder window then select the Finder Preferences menu. Select the
Advanced tab and check the box for “Show all filename extensions”.
To submit an assignment, you can only send in one file, however, you often need to send in at least
all the source code files and most assignments have multiple files. To make this possible we first create
a Zip file that can contain other files. This is almost like a folder, and in fact is sometimes referred to
as a compressed folder – compressed since special algorithms are used to make it use less storage
space than one would expect.
On Windows, to create a Zip file, right-click on the hello.py file, select ‘Send to’ and then click on
‘Compressed (zipped) folder’.
Page 25/34
A Zip file has an icon that usually includes a little zip. If you do not see the new file, press F5 to
refresh the window.
On Mac, the procedure is similar, right-click on the hello.py file and select ‘Compress hello.py’. Again,
the new file should have an icon that includes a little ZIP.
Now, you should rename the Zip file Orientation_ABCXYZ123, where ABCXYZ123 is your student
number – this practice helps staff easily identify the owners of files submitted for an assignment.
On Windows, Right-click and select Rename.
Page 26/34
On Mac, click on the file, then press Enter/Return. A text box appears around the name so you can
edit it.
For this orientation, this is all you need to do to create the Zip file. From the very first assignment,
however, you will have to include multiple files. To do this, just select all the items you want before
right-clicking (on Mac or Windows).
7. Submission of Assignment
Assignments must be submitted on time. Any assignment that is handed in late is usually assessed a
10% penalty per day late, up to the 5th day – after that a mark of zero will be assigned!
Run Chrome as before and go to the Amathuba website. Log in and switch to the class website. On the
course homepage, you will see “Course Content”, scroll down until you see “Automatic Marker”.
Page 27/34
Click on Automatic Marker. The automatic Marker will open in a new tab. You will get a screen similar
to the one below:
A list of all assignments is displayed, and you can click on the one that you wish to submit. For this
orientation task, you want to use Assignment 1: Orientation and Academic Dishonesty for Computer
Program Submissions Policy Acceptance. The date indicates when the assignment is due and if your
assignment is late this will be indicated by a change in colour, as well as the penalty you will be
assessed for late submission. The number of attempts indicates how many times you have submitted
Page 28/34
this assignment and how many times you are allowed. In general, you can resubmit your assignment
until you are satisfied with the result you obtain – the last mark is the one that we will use.
Assignments are listed as Open or Closed – Open assignments may still be submitted but the deadline
has already passed for Closed assignments.
Click on Choose File and choose your Zip file.
Then, click on Submit and your assignment will be submitted and marked automatically. The system
unzips your file and then executes a battery of tests against it. In this case, there is only one question
and only one trial that is done.
The output should be as shown above, but it is possible that something went wrong and instead you
got errors and less than 100 marks. In this case, study the error report closely as it will suggest what
went wrong. The automatic marker will indicate what the expected output was, what output was
produced when your program was run, and the differences between the 2.
Page 29/34
7.1.1 Incorrect naming of files
The screenshot above illustrates an example of a case where the file submitted to the automarker has
a different name from what the automarker is expecting. The automarker is expecting a file named
“hello.py” but instead it found “Hello.py”. Note that the file names are case sensitive. “H” and “h” are
interpreted differently in this case. Furthermore, “hello” and “Hello” are two different names in
Python. Usually, the automarker will give the following error message:
python3: can't open file 'hello.py': [Errno 2] No such file or directory
This means that the file that the automarker is expecting is “hello.py” (pay attention to the lowercase
‘h’). To fix this error, rename your file accordingly and resubmit to the automarker.
Page 30/34
Again, I am getting the following error:
python3: can't open file 'hello.py': [Errno 2] No such file or directory
This is because the automarker could not find find the Python3 file “hello.py” after decompressing the
ZIP archive. Instead, the automarker found the folder “Orientation”. To correct this error, make sure
that you do not compress a folder before submitting your work to the automarker.
7.1.3 Submitting a Program with Syntax Errors
Consider the program in the screenshot given below. You will notice that I have omitted the closing
bracket of the “print()” function therefore, the compiler continued to execute the program until it
terminated at line 8 and it could not find the closing bracket as expected. This is a syntax error in
Python.
If you submit a program that does not compile, such as the one on the previous page, the automarker
will also indicate your errors as shown in the screenshot below.
Page 31/34
When reading the automarker report, you will notice that it will tell you where your error lies in the
program by giving you the line number and the type of error it is. See the frame below:
The expected output was:
Hello World
In this case, you need to go back to your program and check line number suggested. However, take
note that sometimes the error might be on a different line from the one that has been suggested. In
this case, the error is actually on line 6 where there is a missing closing bracket. The compiler has
picked up line 8 because that was where it hit the terminal line in the execution of the program while
looking for the closing bracket. This is an unexpected end of file (EOF) error.
7.1.4 Submitting an uncompressed file to the Automatic Marker
Page 32/34
If you forget to add your Python file to a ZIP archive prior to submitting it to the automarker, you will
get the following error:
python3: can't open file 'hello.py': [Errno 2] No such file or directory
This is because when the automarker gets to the “unzipping file” stage, it could not find any ZIP archive
to unzip. As a result, you will get an error.
VERY IMPORTANT: Make sure that the files listed in the unzipping step are in fact what should be in
the Zip file and that you have submitted a Zip file and not something else. If you are not able to fix the
problem, ask for help.
At the bottom of the screen is the table of assignments and now it indicates your submission and the
mark you got. The submit button is still there because you have not exhausted your permitted
submissions and the assignment deadline has not passed. If you got less than 100, and you have time
to try again and resubmit, you should do so!
You can also check that Amathuba knows about your mark – if you click on Activities and then
Assignments you will see the list of Assignments, and the mark you just obtained against each
assignment. In general, this section is where the questions for assignments can be obtained.
Page 33/34
(Note: The Amathuba Assignment section also can be used to submit assignments that are not
automatically marked – this is used in other courses.)
That’s it folks! This is essentially the end of the orientation exercise.
The following sections contain a couple of garnishes. You will need to use this information for your
assignments – it is not optional!
9. Python Documentation
In WING IDE, under Help, there is a link to Python documentation and some tutorials. Please be careful
as, each time you use this, it will use some of your Internet bandwidth! Instead, consider downloading
the PDF version and storing it on your USB drive.
Alternatively, here is a link to the UCT Computer Science Python Programming Documentation:
http://docs.cs.uct.ac.za
END
Stephan Jamieson, March 2021
Lebeko Poulo, February 2023
Page 34/34