tutorial net
*********WOOOOOOW *********
We're happy to see you're enjoying our races (already 5 pages viewed today)! You can keep checking out by becoming a member of the tutorial net community. It's free!

You will also be able to keep track of your race progress, practice on exercises, and chat with other members.

Go down
Posts : 200
Join date : 2017-11-11
Age : 27
Location : algeria
View user profilehttp://www.tutorial-net.com

tutorial Python - definition Python

on Fri Mar 30, 2018 10:18 am
You have decided to learn Python and I can only congratulate you. I will try to anticipate your questions and leave no one behind.

In this chapter, I will first explain what a programming language is. We will then briefly see the story of Python, so that you at least know where this language comes from! This chapter is theoretical but I urge you to read it anyway.

The final section will cover the installation of Python, an essential step to continue this tutorial. Whether you are working with Windows, Linux or Mac OS X, you will find precise explanations of the installation.

Come on, we attack!

A programming language? What is it ?
Human communication
No, this is not a biological or philosophical explanation, do not leave!
Very simply, if you come to understand these sequences of strange and disconcerting symbols that are the letters of the alphabet, it is because we respect certain conventions, in language and in writing. In French, there are rules of grammar and spelling, I do not teach you anything. You communicate by knowing more or less consciously these rules and by applying them more or less well, as the case may be.
However, these rules can easily be circumvented: no one can claim to know all the rules of French grammar and spelling, and few people care. After all, even if you make mistakes, people with whom you communicate can easily understand you.
When you communicate with a computer, however, it's very different.

My computer communicates too!
Yes, your computer communicates constantly with you and you communicate with him constantly. Okay, he tells you very rarely that he is hungry, that the summer promises to be scorching and that the last disc of this well-known band was crying.
There is nothing magic if, when you click on the small cross at the top right of the current application, it understands that it must close.

Machine language
In fact, your computer is also based on a language to communicate with you or with itself. The operations that a computer can perform at the base are most classic and consist of the addition of two numbers, their subtraction, their multiplication, their division, whole or not. And yet, these five operations are amply enough to run the most complex simulation software or super-realistic games.
All these programs work roughly the same way:

a sequence of instructions written in machine language composes the program;

when running the program, these instructions describe to the computer what to do (the computer can not guess).

A list of instructions? What is it still?

By schematizing voluntarily, an instruction could ask the program to close if you click on the cross at the top right of your screen, or stay in the background if that is his pleasure. However, in machine language, such an action alone requires a large number of instructions.
But hey, you can imagine, talking with the computer in machine language, which includes only the binary, it is neither very rewarding nor very practical, and in any case not very funny.
We have invented programming languages ​​to facilitate communication with the computer.
The binary language consists only of 0 and 1. "01000010011011110110111001101010011011110111010101110010", for example, means "Hello". In short, as much as you say that binary discussion with a computer can be long (especially for you).

Programming languages
Programming languages ​​are languages ​​much easier to understand for us, poor human beings than we are. The mechanism remains the same, but the language is much more understandable. Instead of writing the instructions in a rather unintelligible sequence of 0 and 1, the orders given to the computer are written in a "language", often in English, with a particular syntax that must be respected. But before the computer can understand this language, it must be translated into machine language (following figure).
[You must be registered and logged in to see this image.]

Translation of a program in binary language
Basically, the programmer "only has" to write lines of code in the language he has chosen, the following steps are automated to allow the computer to decode them.

There are a lot of programming languages ​​and Python is one of them. It is not necessary for the moment to give more explanations on these very schematized mechanisms. If you have not managed to understand the vocabulary words and all of these explanations, it will not penalize you for the future. But I found it interesting to give these details about how to communicate with your computer.

For the little story
Python is a programming language, the first version of which was released in 1991. Created by Guido van Rossum , he traveled from his creator's Macintosh, which was working at that time at the Centrum voor Wiskunde in Informatica in the Netherlands, until to be associated with a particularly dedicated non-profit organization, the Python Software Foundation , created in 2001. This language was named in tribute to the troupe of comedians "Monty Python".

What can Python do?
Python is a powerful language that is both easy to learn and rich in possibilities. From the moment you install it on your computer, you have many features built into the language that we will discover throughout this book.

It is also very easy to extend the existing features, as we will see. Thus, there are so-called libraries that help the developer to work on particular projects. Several libraries can thus be installed to, for example, develop graphical interfaces in Python.

Concretely, that's what we can do with Python:

small, very simple programs, called scripts , loaded with a very precise mission on your computer;

complete programs, such as games, office suites, multimedia software, email clients ...

very complex projects, such as software packages (set of several software that can work together, mainly used in the professional world).

Here are some of the features offered by Python and its libraries:

create graphical interfaces;

circulate information through a network;

interact in an advanced way with your operating system;

… and many more…

Of course, you will not learn to do all this in minutes. But this course will give you bases broad enough to develop projects that can become, thereafter, quite important.

An interpreted programming language
Yes, you will have to wait a little longer because I have two or three things to explain to you, and I am convinced that it is important to know a minimum these details that may seem impractical at first glance.
Python is an interpreted programming language , meaning that the instructions you send to it are "transcribed" in machine language as they are read. Other languages ​​(such as C / C ++) are called " compiled languages " because, before they can be executed, specialized software is used to transform the code of the program into machine language. This step is called " compilation ". Whenever you change the code, you must recall a compilation step.

The advantages of an interpreted language are simplicity (we do not go through a compilation step before running its program) and portability (a language such as Python is supposed to work on Windows as well as on Linux or Mac OS, and one should not have to make any change in the code to move it from one system to another). This does not mean that the compiled languages ​​are not portable, far from it! But we must use different compilers and, from one system to another, some instructions are not compatible or behave differently.

In return, a compiled language will prove much faster than an interpreted language (the translation on the fly of your program slows the execution), although this difference tends to be less and less felt over the improvements. In addition, you will need to install Python on the operating system you are using for the computer to understand your code.

Different versions of Python
When the Python Software Foundation was created in 2001, and in the years that followed, the Python language went through a series of versions that were included in the Python 2.x (2.3, 2.5, 2.6 ...). Since February 13, 2009, version 3.0.1 is available. This version breaks the backward compatibility that prevailed in the latest versions.

Compatibility what?

When a programming language is updated, developers are careful not to overwrite or overwrite old features. The point is that a program that runs under a certain version will always work with the new version. However, the Python Software Foundation, observing a good number of obsolete features, implemented several times ... decided to clean the entire project. A program that runs perfectly under Python 2.x will need to be updated to a minimum to run again under Python 3. That's why I will advise you later to download and install the latest version of Python . I will indeed focus on the features of Python 3 and some of
Back to top
Permissions in this forum:
You cannot reply to topics in this forum