PYTHON



Python is a name of a programming language (you didn't expect this, huh?).

Though the name's origin is not related to the snake. The title came from "Monty Python's Flying Circus", a British sketch comedy show, which was recorded in the 70s. Here is a DVD cover with the stylish guy in a bowler hat:

"Monty Python's Flying Circus" Poster. Source: http://mmas.unca­.edu:16080/­~lhan/class/38­8px-CompleteFlying­CircusDVD.jpg. Created in 1969. The author or rights holder: BBC TV

If a creator names his programming language in honor of a comedy show, it must be ironic a little and understandable enough. Python stands out by its simplicity, especially in the case of the syntax. Python has managed to avoid the conventionality of some constructions, specific to such languages as C++ or Java. Program text is read easily, blocks are seen clearly (just four spaces, and nothing else matters). Yeah, there is no long and overcomplicated expressions.

Good language. Cool language. Decent language.

Programming language is formal and accurate. It has its own vocabulary, rules, and syntax. Written in programming language, programs can be run by CPU on different devices.

To write a text, we need a secretary Microsoft Word - to write a program, we need knowledge of programming language.

A program is an algorithm of a particular task's solution. Look, for example, at the part of the program, which works on your device right now, and by which you can read this coursebook. This is Java: int old_position = prefs.getolds(); if (enabled_old) { MI mMI = prefs.gmLast(); togo(mMI, old_position); }

Don't worry if the code seems complex to you. When you drive a car for the first time, it's scary, unusual, and confusing. Later you begin to understand and get used to it. Actually, this small block of code allows you to continue reading where you left off (can be enabled or turned off on the menu).

What are we going to do? At first, we will learn Python statements and expressions. You'll be shown what they do and what they are for. After that, we will learn to write commands in the right order according to the algorithm. Having written a program, we'll force the computer to run it, proudly looking at the result... or will return to correct mistakes in the code.

Put simply, we will process data using a computer.


PYTHON INSTAL­LATION


Python is absolutely free, so let's download and install it already.

I am sure that if you really want to master programming, Python installation won't cause any trouble.

Here you can find my video on Youtube about downloading and installation of Python. Click the link to watch it.



1. DOWN­LOADING


It's pretty easy to find Python's site using a keyword "Python" in any search engine. Here it comes www.python.org

Choose an appropriate version and download it:



2. RUNNING THE IN­STALLER


There are some comments about the installation:

The checkbox "Add Python x.x to PATH" (x.x is the current version of Python) must be selected necessarily. It allows to access Python, wherever it is hidden in the system, and to launch Python by simple double-click on it.

  1. During the installation, select the checkbox "Add Python x.x to PATH" and choose "Customize installation":

  2. Select all the items in the next installation window:

  3. Choose install location. I recommend selecting any disk but system one. For example, pick the root directory D:, and the path will look just like mine: D:\Python. Moreover, select these checkboxes:

  4. Wait for finishing of Python's installation, take a deep breath, and smile:



3. CREATING A SHORT­CUT AND RUN­NING PYTHON


Unfortunately, you won't see a usual clearly visible shortcut. We need to make it ourselves (don't try to launch python.exe, you just won't succeed). Use IDLE Python instead (IDLE is the simplest text editor with integrated Python). After successful installation, it is located in the start menu if we speak about Windows. Type "Python" into the search bar and take out the trash create a shortcut. To install Python on other OS, please, look for another tutorial.

You can also create a shortcut by yourself, having written pythonw.exe as a program and idle.pyw as a an argument. This is how it works on my computer:

D:\Python\pythonw.exe "D:\Python\Lib\idlelib\idle.pyw"

It will look like:

Double-click on the icon to launch Python. Further you will see Python Shell. How to set it up and how to work with it... in the next part. Take a break and rest a little.


© 2019-2021 Viktor Trofimov
© 2019-2021 Translation and adaptation by Danil Shentsov
[ Top page ]