Programming Tutorial One
|
This is the simplest of the programming examples. In this one, you will create your
programming environment by downloading the free python software, installing it on your
computer and running the "Hello World" program.
|
|
Process Description --
|
Download:
You will download the Python Interpreter:
-
Go to www.python.org
-
Select the 3.4.0 version of Python
-
Indicate what type of computer you have (PC/Mac/Linux)
|
Installation:
You will install the Python code you just downloaded:
-
Find the download in the "My Downloads" folder
-
Click on the download
-
Select "Run", then click "Next" several times and then
select "Finish"
|
Run the "Hello World" Program:
Follow these steps:
-
Open Notepad
-
Enter these 2 lines into Notepad:
print ("Hello World")
input (" ")
-
Save the file as helloworld.py on the desktop
-
Double click on helloworld.py
|
Creating the Program --
|
In order to write a program you must first have the compiler or interpreter
that converts what you are going to write into computer language on your
computer. For this exercise we have selected the free "and popular"
computer programming language called Python.
|
- Go to the Python website at
www.python.org
- Click on the "Downloads" button found
on the front page of the website
|
|
- Select the button "Download Python 3.4.0" (Note: the computer you
are on should have selected the right version for your platform PC/Mac/Linux.
If not, scroll down to select the correct version)
|
|
-
When you have currectly initiated the download, you should have a box that
looks like the following:
-
Click the "Save File" button.
|
|
- Once the file is downloaded it should be in the download area of your
browser. On Firefox click the down arrow at the upper right corner of
the browser window or select "tools" and then "Downloads" from the menu bar.
Click on the download
|
|
-
If you clicked on the download it should launch with the following window:
-
Select the "Run" button
|
|
- You will now see a series of screens with the Python logo. Click the
"Next" button on each screen until you see a "Finish" button. This will
accept the default installation
|
|
- When you see the screen to the right, you have successfully installed
Python on your computer. Click the "Finish" button to complete the
installation
|
|
- You are now ready to launch the Python Interpreter. Go into "All Programs"
and select the "IDLE Python GUI" application
|
|
The Python GUI is shown to the right:
|
|
- Once you have reached this point, type the following code into the Python
interface:
- print ("Hello World")
|
|
-
You have now proved that you have a running version of Python on your computer.
Let's make sure your computer is properly associating Python programs
-
Open Notepad -- On Windows 7 and before, Notepad is in the "Accessories"
folder. In Windows 8, just search for Notepad. (Note: If you are on a Mac,
use TextEdit)
|
|
- Type the same line of program code into Notepad:
- print ("Hello World")
|
|
- Add the following line of code on the next line as shown:
- input (" ")
|
|
- Save the file using the file name "HelloWorld.py" on the desktop
|
|
- Run the file by clicking on it
- If you have received the window to the right,
you have successfully installed Python on your computer
|
|
Return to Assignments Index
|