Evgenij LegotskojFeb. 13, 2018, 5:02 p.m.

Python 3 - Tutorial 001. Introduce

Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python source code is also available under the GNU General Public License (GPL). Python is named after a TV Show called ‘Monty Python’s Flying Circus’ and not after Python-the snake.

Python 3.0 was released in 2008. Although this version is supposed to be backward incompatibles, later on many of its important features have been backported to be compatible with version 2.7.


This tutorial is designed for software programmers who want to upgrade their Python skills to Python 3. This tutorial can also be used to learn Python programming language from scratch.


This tutorial is for software developers who want to upgrade their Python skills to Python 3. This tutorial can also be used to learn the Python programming language from scratch.

The necessary conditions

You must have a basic understanding of the terms of computer programming. The basic understanding of any of the programming languages is a plus.

Executing Python programs

The Python program files has the extension py. Programs are run using the Python interpreter.

For example, such a program written in the file main.py


print ("Hello, Python!")

You can run it by running the following command in the console

python3 main.py

The output will be as follows

Hello, Python!


Python is a high-level, interpretable, interactive and object-oriented scripting language. Python is designed to be readable. He often uses English keywords, while other languages use punctuation. It has fewer syntactic constructions than other languages.

  • Python is interpreted - Python is processed at run-time by the interpreter. You do not need to compile your program before executing it. This is similar to PERL and PHP.
    Python is interactive - you can use Python hints and interact directly with the interpreter to write your own programs.
    Python is object-oriented. Python supports an object-oriented programming style that is encapsulated within objects.
    Python is a language for beginners. Python is an excellent language for novice programmers and supports the development of a wide range of applications from simple text processing to web browsers for games.

History of Python

Python was developed by Guido van Rossum in the late 80s and early nineties at the National Research Institute of Mathematics and Informatics in the Netherlands.

  • Python is derived from many other languages, including ABC, Modula-3, C, C ++, Algol-68, SmallTalk and Unix shell and other scripting languages.
  • Python is protected by copyright. Like Perl, the Python source code is now available under the GNU General Public License (GPL).
  • Python is now supported by the core development team at the institute, although Guido van Rossum still plays a vital role in guiding his progress.
  • Python 1.0 was released in November 1994. In 2000, Python 2.0 was released. Python 2.7.14 is the latest version of Python 2.
  • Meanwhile, Python 3.0 was released in 2008. Python 3 is not compatible with Python 2. Compatibility with Python 3 was to remove duplicate software constructs and modules to "have one, and maybe one, an obvious way to do this." Python 3.6.4 is the latest version of Python 3.

Python Features

Ease of learning - Python has several keywords, a simple structure and a well-defined syntax. This allows the student to quickly pick up the language.

  • Easily readable - the Python code is more clearly defined and visible to the eyes.
  • Easy-to-maintain - Python source code is fairly easy to maintain.
  • Wide standard library - the main part of the Python library is very portable and cross-platform compatible with UNIX, Windows and Macintosh.
  • Interactive mode - Python supports interactive mode, which allows you to interactively test and debug code snippets.
  • Portable - Python can run on a variety of hardware platforms and have the same interface on all platforms.
  • Expandable - you can add low-level modules to the Python interpreter. These modules allow programmers to add or customize their tools to improve efficiency.
  • Databases - Python provides interfaces for all major commercial databases.
  • Programming GUI - Python supports graphical applications that can be created and transferred to many system calls, libraries and Windows systems, such as Windows MFC, Macintosh and X Window Unix systems.
  • Scalability - Python provides better structure and support for larger programs than shells.

In addition to the above functions, Python has a large list of good functions. A, few are listed below -

  • It supports functional and structured programming methods, as well as OOP.
  • It can be used as a scripting language or can be compiled into bytecode to create large applications.
  • It provides very high-level dynamic data types and supports dynamic type checking.
  • It supports automatic garbage collection.
  • It can be easily integrated with C, C ++, COM, ActiveX, CORBA and Java.
We recommend hosting TIMEWEB
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.
Support the author Donate
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> #!/usr/bin/python3
>>> print(Hello,Python!)
python3 main.py
SyntaxError: invalid syntax
=============================== RESTART: Shell ===============================
>>> #!/usr/bin/python3
>>> print("Hello,Python!")
python3 main.py
SyntaxError: invalid syntax
>>> Hello,Python!
SyntaxError: invalid syntax
>>>  помогите плиз почему у меня так пишет,

Добрый день!

Вот это линуксовая директива


Указывает, где находится python пакет в системе. А вы видимо под windows разрабатываете.

Попробуйте просто удалить эту строку.

Я надеюсь вы уже разобрались в чем дело, но если вдруг нет, то проблема состоит в том, что вы пытаетесь запустить программу из интерпретатора питона.

Файл main.py это уже готовая программа которая выводит в терминал (командную строку) текст:

Hello, Python!

Эту (готовую) программу нужно запускать из интерпретатора команд вашей ОС (Windows: cmd, powershell; UNIX: bash, zsh, csh ...) а не из интерпретатора питона.

Текст файла main.py :

print ("Hello, Python!")

Программа для запуска из выполняемой среды ОС (открыть файл main.py в программе python ):

python main.py

если же вы уже запустили интерпретатор python, то вам достаточно просто написать команду:

print('Hello, Python!')


Only authorized users can post comments.
Please, Log in or Sign up

Let me recommend you the excellent hosting on which EVILEG is located.

For many years, Timeweb has been proving his stability.

For projects on Django I recommend VDS hosting

View Hosting

C++ - Test 005. Structures and Classes

  • Result:75points,
  • Rating points2

C++ - Test 005. Structures and Classes

  • Result:25points,
  • Rating points-10

C++ - Тест 003. Условия и циклы

  • Result:28points,
  • Rating points-10
Last comments

Qt/C++ - Lesson 008. QDataWidgetMapper - Working with the database via a widget

Понял сам так - происходит через setTable() "Sets the database table on which the model operates to tableName. Does not select data from the table, but fetches its field information", а затем че…

Qt/C++ - Lesson 008. QDataWidgetMapper - Working with the database via a widget

Начал делать что-то похожее, но без sql. Не очень понимаю, что делает mapper->setCurrentModelIndex(model->index(row,0)); Вернее не понимаю вот что: откуда он берёт данные, кот…

Qt/C++ - Lesson 048. QThread — How to work with threads using moveToThread

Не получается сделать connect, получаю гору ошибок. В чем может быть дело ?

Qt/C++ - Lesson 034. Echo Server based on QTcpServer

Добрый день, разрешите вопрос: во всех примерах работы с QTcpServer его всегда создают в main.cpp, нет ли возможности корректно сохдать его в MainWindow.cpp ? Просто если перенести код…

Django - Tutorial 001. Deploying a site on Django + PostgreSQL + Gunicorn + Nginx

А почему нельзя? Где можно об этом почитать? Киньте, пожалуйста, в меня ссылкой.
Now discuss on the forum

Отправка картинки в DRF

Да я знаю ;-) используйте, пожалуйста, в следующий раз средства сайта. В данном случае сторонний сервис ни к месту.
  • BlinCT
  • April 9, 2021, 8:15 a.m.

Работа с созданным обьектом qml через Qt.createComponent

Добрый день. И как это решает мою проблему?) Item{ id: root property var model property bool headers : false property string objectName property int iMaxWidthRow:…

Проект на cmake и QCharts

Кто-нибудь сталкивался с проблемой скроллинша чарта ? если допустим увеличить в ширину сам чарт, как скроолить весь чарт а не только его видимую часть ?

Ожидание ввода QLineEdit

Попробовал, крешится напрочь... Такое чуство что таймер не удаляется.... и к нему снова идет обращение....

QScrollArea dynamically add QCheckBoxes

Всё правильно. Это просто спамер, который отправился в вечный бан.
© EVILEG 2015-2020
Recommend hosting TIMEWEB