Pin It

Introduction to Python

 PYTHON is an object orientated high-level interpreted language.  Python is easy to use but at the same time it's extremely powerful. One of the first high-level programming languages were; BASIC, COBOL, C, C++, FORTRAN, Pascal, etc... Languages that are referred as high-level languages, is because they are easier to understand due to the fact that the written code is more similar to human language instead of machine language that only computers understand. The programs that you write using high-level language will work on any type of computer or platform.

Programs written in a high-level language must be translated into machine language. To do that, one way is to compile the program by running it through a compiler and then run it, and the other way is to execute the program through an interpreter (as we will do during our python course).

An interpreter is a computer program that translates code (program instructions) written using one of many high-level programming languages on the fly. The advantage of an interpreter is that it can immediately execute high-level programs. The Windows command prompt is an interpreter. When you are using the Python interpreter, the prompt will look like this; '>>>'. Using python interpreter allows you to run just one piece of code to see its output. How to access the python interpreter is shown in one of the videos below.

A compiler on the other hand, translates high-level instructions directly into machine language. Once a program is compiled it will run faster in relation to interpreted programs, but if the program is very large it is time-consuming to complile it.

During our course we will be using the Python high-level programming language, and the Windows command prompt will be the interpreter. We will create a python file, save it on the desktop in the root folder of our project and run the program (or view the code's output) through the Windows command prompt window.

Compiler vs interpreter

Examples of interpreters are python, ruby, php and perl interpreters. An interpreted language, like python is a language that executes statements of code one by one. Examples of python interpreters that can be used in Windows 10 is the Windows Command Prompt or the Windows powershell. Both of these are included with Windows 10. For example when you type Python code, the code gets interpreted by the interpreter to machine language, that is a language that the computer understands. A compiler on the other hand executes the complete code all at once, and if there is an error in the code, an error will be displayed. Examples of compilers are C, C++, java.

NOTES

What is Python IDLE?
IDLE is Python's Integrated Development and Learning Environment. It’s an interactive interpreter (Python shell window)

 

 

 

Preparing your environment for Python practice

Preparing your environment for python practice using platformio-ide-terminal package

Ways of accessing python interpreter