>A Byte of Python

Using A Source File

Okay, now let's get back to some programming. We will write the traditional "Hello World" program - whenever you learn a new programming language, the first program that you write and run is usually a Hello World program. As Simon Cozens (one of the leading Perl6/Parrot hackers) puts it, it is the traditional incantation to the programming gods to help you learn the language better.

Open your editor of choice, enter the following program and save it as hello_world.py. All Python programs usually have the file extension .py .

Run this program by opening a shell (Linux terminal or DOS prompt) and entering the command python hello_world.py. If you are using IDLE, use the menu Edit -> Run Script or the keyboard shortcut Ctrl-F5. The output is as shown below.