0% found this document useful (0 votes)
5 views

Python2

Python is an open-source, cross-platform programming language that has gained popularity since its release in 1991, with the latest version being 3.7.0. It is an interpreted, multi-purpose language suitable for various applications such as scientific computing and web development, and it supports object-oriented programming. The document also compares interpreted languages like Python with compiled languages, highlighting their respective advantages and use cases.

Uploaded by

suren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Python2

Python is an open-source, cross-platform programming language that has gained popularity since its release in 1991, with the latest version being 3.7.0. It is an interpreted, multi-purpose language suitable for various applications such as scientific computing and web development, and it supports object-oriented programming. The document also compares interpreted languages like Python with compiled languages, highlighting their respective advantages and use cases.

Uploaded by

suren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

2.

1 Introduction to Python
Python is an open source and cross-platform programming language, that has
become increasingly popular over the last ten years. It was _rst released in
1991. Latest version is 3.7.0. CPython is the reference implementation of the
Python programming language. Written in C, CPython is the default and most
widely-used implementation of the language.
Python is a multi-purpose programming languages (due to its many extensions),
examples are scienti_c computing and calculations, simulations, web develop-
ment (using, e.g., the Django Web framework), etc.
Python Home Page [6]:
https://www.python.org
The programming language is maintained and available from (Python Software
Foundation): https://www.python.org Here you can download the basic Python
features in one package, which includes the Python programming language in-
terpreter, and a basic code editor, or an integrated development environment,
called IDLE. See Figure 2.1
But this is just the Python core, i.e. the interpreter a very basic editor, and the
minimum needed to create basic Python programs.
Typically you will need more features for solving your tasks. Then you can in-
stall and use separate Python packages created by third parties. These packages
need to be downloaded and installed separately (typically you use something
called PIP), or you choose to use, e.g., a distribution package like Anaconda.
Python is an object-oriented programming language (OOP), but you can use
Python in basic application without the need to know about or use the object-
oriented features in Python.
Python is an interpreted programming language, this means that as a developer
17
Figure 2.1: IDLE - Basic Python Editor
you write Python (.py) _les in a text editor and then put those _les into the
python interpreter to be executed. Depending on the Editor you are using, this
is either done automatically, or you need to do it manually.
Here are some important Python sources: [6], [7], [8].
2.1.1 Interpreted vs. Compiled
What are the di_erences between Interpreted programming languages and Com-
piled programming languages? What kind should you choose, and why should
you bother?
Programming languages generally fall into one of two categories: Compiled or
Interpreted. With a compiled language, code you enter is reduced to a set of
machine-speci_c instructions before being saved as an executable _le.
Both approaches have their advantages and disadvantages.
18
With interpreted languages, the code is saved in the same format that you en-
tered. Compiled programs generally run faster than interpreted ones because
interpreted programs must be reduced to machine instructions at run-time. It
is usually easier to develop applications in an interpreted environment because
you don't have to recompile your application each time you want to test a small
section.
Python is an interpreted programming language, while e.g., C/C++ are trans-
lated by running the source code through a compiler, i.e., C/C++ are compiled
languages.
Interpreted languages, in contrast, must be parsed, interpreted, and executed
each time the program is run.
Another example of an interpreted programming language is PHP, which is
mainly used to create dynamic web pages and web applications.
Compiled languages are all translated by running the source code through a
compiler. This results in very e_cient code that can be executed any number of
times. The overhead for the translation is incurred just once, when the source
is compiled; thereafter, it need only be loaded and executed.
During the design of an application, you might need to decide whether to use a
compiled language or an interpreted language for the application source code.
Interpreted languages, in contrast, must be parsed, interpreted, and executed
each time the program is run
Thus, an interpreted language is generally more suited for doing "ad hoc" cal-
culations or simulations, while compiled languages are better for permanent
applications where speed is in focus.

You might also like