Getting Started

Posted by Neville on September 10, 2016 under How To, Python, Resources, Training | Comments are off for this article

What Is Programming?

Computer Programming Languages

A computer is basically a machine that can do a small number of different calculations and store results of these memory to be either put out for the user to use or be incorporated in further calculations. These calculations can be done incredibly quickly and the space for the memory can be huge.

Information for the computer to use for the calculations and the storage of the results in memory can be given in very basic instructions consisting 0s and 1s, or binary notation. However, directly delivering those instructions would very difficult for all but a few very determined programmers able to abstract complicated instructions down to those that can be acted on by the computer.

That is where computer programming languages come into play. These have been devised to make it simpler for programmers to write instructions much closer to their natural language, and hence easier to produce. There are many different languages, and each has its own advantages when compared with others. This post will not expand on that situation, but simply note that the language that a programmer uses will have to interpreted and translated into the machine language that the computer uses.

Python is an example of in Interpreted Language. A coder in python develops a set of instructions using a standard set of keywords, commands, operations and styling formats that is presented to an interpreter that checks the code and converts it to instructions that the computer’s processing unit can act upon.

What is needed to program in Python?

The Shell

When python is installed on your machine one of the things that is set up is the Shell. This basically allows

python shell

python shell

instructions to be typed in directly to the interpreter, that then translates and performs any operations in those instructions. In the example shown in this image, the interpreter takes in the print() command and then prints out the required string between the ().

The shell is ready to use when the triple Greater Than symbol (>>>) is showing as the bottom line. Instructions are typed there and submitted for interpretation when the Enter key is pressed.

If the instruction(s) can not be processed an error message will be shown. Get used to that!!! It will happen many times in the process of learning how to code.

The IDE

Python is an interpreted language, which means that the programs that you write (the code), has to be checked for correctness (syntax) before the compiler translates the code into the basic actions that the computer’s processing unit can handle.

Idle

Idle

To help create the code an Integrated DeveLopment Environment is often used. Most similar languages call this an IDE, but perhaps as recognition of one of the Monty Python team, Eric Idle, Python calls this an IDLE!

Idle has 2 components. The Shell (which acts in a similar way to the shell as noted above) and the Text Editor. That Text Editor is used for writing and preparing code. It generally has color-coded hints such as reserved words, tips about parameters that are required for functions and where brackets may be needed. Code in the Editor has to be saved as a file before it can be run and the output is generated in the Shell.

There are several sites that can help you walk through the installation of IDLE, so if the basic instructions here do not help, a Google (or other search engine) search will help find a more detailed set of instructions.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Comments are closed.