Where is Python used? What software is written in Python? Benefits of the Python programming language. No good distribution tools

Python is a widely used, high-level programming language that was named after the famous British comedy television show " Monty Python's Flying Circus». Python language simple in structure, and at the same time incredibly flexible and powerful. Given that Python code is easy to read and without being too rigid in syntax, many consider it to be the best introductory programming language.

Python - description of the language given in Foundation describes Python:

Python is an interpreted, interactive, object-oriented programming language. It includes modules, exceptions, dynamic typing, high-level dynamic types data and classes. Python combines excellent performance with clear syntax. It implements interfaces to many system calls and libraries, as well as various window systems, and it is extensible with C and C++. Python is used as an extension language for applications that need software interface. Finally, Python is a cross-platform language: it runs on many versions of Unix, Macs, and computers running MS-DOS, Windows, Windows NT, and OS/2.

Which programming language should you learn first?

You can start learning the Python programming language. To illustrate how Python differs from other introductory languages, think back to when you were a teenager.

Learn programming with using Python similar to driving your parents' minivan. Once you've driven it around a few times in a parking lot, you'll begin to understand how to handle the car.

Trying to learn programming using C ( or even assembler) it's like learning to drive by assembling your parents' minivan. You'll be stuck in a garage for years putting parts together, and by the time you have a full understanding of how the car works and are able to troubleshoot and predict future problems, you'll be burned out before you ever get behind the wheel.

Benefits of Python

Python is a universal language for beginners. You can automate workflows, create websites, and create desktop applications and games using Python. By the way, the demand for Python developers ( PostgreSQL, OOP, Flask, Django) has grown dramatically over the past few years in companies such as Instagram, Reddit, Tumblr, YouTube and Pinterest.

High-level general purpose language

Python is a high-level programming language. Using it, you can create almost any type of software. This versatility keeps you interested as you develop programs and solutions that target your interests rather than getting stuck in the weeds of a language worrying about its syntax.

Interpreted language

Language Python programming for beginners is interpreted, which means you don't need to know how to compile the code. Since there is no compilation step, productivity increases and time for editing, testing and debugging is greatly reduced. Just download the IDE ( IDE), write your code and click “Run” ( Run).

Code readability is key

Python's simple, easy-to-learn syntax emphasizes readability and sets a good programming style. With Python, you can express your concept in fewer lines of code. This language also forces you to think about program logic and algorithms. Because of this, it is often used as a scripting or integration language ( glue language) to link existing components together and write large volumes of easily readable and runnable code in short periods of time.

It's just fun

You can't name a programming language after Monty Python without having a sense of humor. Moreover, testing was carried out to compare the time required to write a simple script in various languages (Python, Java, C, J, BASIC):

...Python requires less time, fewer lines of code, and fewer concepts to achieve your goal... And to top it all off, Python programming is fun! Having fun and frequent success builds confidence and interest in students, who become better prepared to continue learning Python.

Translation of the article “Why Learn Python? "was prepared by the friendly project team.

Good bad

Skillbox students, a teacher and a developer talk about the features of the language and market requirements.

To bookmarks

Material prepared with the support of

In a series of publications, students of the online educational platform talk about what prompted them to master a new specialty, teachers defend methods, and experts explain why such specialists are needed in the first place.

It is a high-level general purpose programming language. The language syntax is minimalistic: this is necessary to increase developer productivity and code readability.

Python is one of the most popular and adaptive languages ​​that is developing very quickly. Python developers are always in demand in the market.

Nikita Sobolev - developer, founder of Wemake.services studio

If you know any other programming language, then learning Python will be very easy. This is my story - I was programming in Java, but suddenly I needed to learn Python. There were no problems: the language was simple, the entry threshold was low.

I had my own projects in Java, but I liked Python more. In particular, with this language I have time to write more code. The productivity of a programmer who works in Python is many times higher. Therefore, our team has completely switched to this language.

After a year of working with Python, you can become much more efficient. For comparison, I have been struggling with the Erlang and Elixir languages ​​for three years and still don’t know much, because they have their own specifics. Python is less difficult.

Programmers with knowledge of Python are in great demand. If you indicate in your Github profile projects with Python that have at least 10–15 stars, then you automatically fall into the algorithms of HR specialists, who begin to flood them with letters every two days: sit down, choose and agree to whatever you like.

Nikita Sobolev

Developer and founder of Wemake.services studio

Companies need a lot of people, but they simply don't exist in that quantity. There are several subsections of Python development on the market, which are now the most popular - employers even hire beginners. The first one is Data Science. This direction is almost entirely based on Python. Specialists need good mathematical training and basic knowledge of the language.

The second subsection is Scrapping. Developers write “spiders” that go around and collect information on sites and use the information received for one purpose or another. Such specialists need basic knowledge of Python programming.

Through these two activities it is easy to enter the field of Python programming: learn basic concepts, you find a job, start getting real money, improve your level and gradually become a serious specialist.

However, naturally, there is web development, which is quite difficult to enter with only basic knowledge. The highest requirements are set in this area. But it’s also possible to take up web development in Python with basic skills. There are two entry options - open source and freelance.

According to my subjective assessments, most of the vacancies are still provided for Java and JavaScript programmers. But Python is in the top three. Many prospects open up for a Python programmer because the platform is quite diverse and is used for different technologies. Career growth is also fast - due to the simplicity of the language.

But despite the demand for Python developers, there are quite a few serious specialists, and they are hard to find. They are all hidden because companies protect them, protect them and pray for them: finding a replacement for such a specialist is extremely difficult.

Vadim Shandrinov - course teacher

I've been programming for 30 years. I first started in eighth grade and continued through college. I have been involved in Python development since 2000.

The advantage of this programming language is that it has a low entry barrier for learning. It will take a few days to write a small primitive code. But much more time will have to be spent on studying more subtle things - libraries, principles and approaches.

Python - open language, there are sources. The programmer can see what other developers are doing and how. Since the language is old, many libraries have been written for it - for all occasions.

Now, it seems to me, Python has become too popular - many organizations have started using it: NASA, Google, Dropbox, Instagram and others. A similar situation was with Java, which is now used by large companies. For example, all Android development takes place in this language.

I study the vacancies that are published on hh.ru: about 200 different offers are available to applicants every day. The market is very large, specialists are in great demand. But there is a failure - companies, as a rule, need a programmer with a Middle or Senior level. Almost all vacancies indicate work experience of two to three years. Junior programmers are very rarely required - usually only large companies like Yandex can afford to hire young specialists.

Therefore, Junior programmers struggle with finding work - they know the language, they have projects, but they cannot find a job, despite the demand.

I think that our course will help bridge this gap: we are preparing specialists with knowledge not just of the language, but also of what libraries and frameworks are available. We are also going to organize internships: we invite companies to become partners so that we can then take on the best for our internship.

The peculiarity of the course is that training begins from the very basics. We have included many gamification elements - I explain some points, as they say, on the fingers. For example, using cartoons or dramatizations.

The course has a large visual component - falling snowflakes, spaceships and other elements are displayed using code. This is much more interesting than just lines in the console.

We immerse students in a professional environment through the use of a version control system. This is the main tool of work for all programmers. I interact with students through Git (distributed version control system): they write code, commit it, upload it to the server, and I review and leave comments.

A commit is a developer comment that describes changes that have occurred in the code.

We can say that we emulate the professional life of a programmer. This is necessary because when hiring, companies ask not about knowledge of version control systems, but about experience working with them.

The course is divided into two parts. The first is devoted to Python itself, programming skills in it. After completing the first part, the student understands whether it is suitable for him or not. The second part of the course is web development using the Django framework. After graduation, the student can position himself as a strong Junior programmer.

Igor, 25 years old - student with little programming experience in C++

I work as a teacher in robotics clubs - I teach children about electronics and programming. I have a higher technical education, but I can call its quality “not good.” I also have basic C++ programming skills.

I regularly read magazines - “Popular Mechanics”, “Machines and Mechanisms” and RBC. These publications talk about the development of the IT industry, machine learning, the Internet of things, blockchain, quantum computers and others. Python is often used in these areas: it is popular and its applications are wide. We can say that the tongue will help you get into a large number of different spheres.

I wanted to get more involved in programming, and I decided to try learning Python. I looked for courses on the Internet, looked at different options and settled on Skillbox.

After each module there is homework - without completing it you will not be able to move on to next topic. The tasks are different. For example, once it was necessary to program a text-based life simulator in which there are people and cats - it was necessary to understand how many animals it could feed.

Teachers check the work from a professional point of view, just like in a real company: the code must not only work, but also be clean. At first it seems that the teacher is nitpicking, but in fact he studies the code thoroughly - this is good.

Igor Sensky

If there are any questions or problematic issues, the tasks are sent for revision. I only managed to pass the initial homework the first time. At the end of the training there must be a final project.

The course provides basic knowledge - this is what it is designed for, based on its content and price. For people who do not have programming skills, it will probably be suitable, but at some point it may seem complicated. At the beginning, basic concepts are given, with which everything is simple, but for more complex ones you need a certain mindset and experience.

My main goal is to check how suitable this training format is for me, since this is the first time in my life that I have enrolled in an online course. If everything goes well, I plan to later find lessons on Python development with a deeper dive.

In my opinion, the basic knowledge that the course provides is equal to the experience of a Junior developer. This means you can get an internship at one company or another.

Alexandra, 29 years old - student with experience in programming in C++

I've been programming for five years. One of the languages ​​I know is C++. But my job is related to science, and writing code is not at the top of my list of responsibilities.

At some point I noticed that I had lost my programming skills because last years I devoted very little time to him. Deciding that I had forgotten how to write code, I decided to learn something new.

I have already for a long time subscribed to Skillbox and saw information about a Python development course. I had never worked with this language before and was not interested in it, although I knew about its existence. In vain: it turned out that it was cool and interesting language programming.

Alexandra Oleynikova

Student

I just recently signed up for the course and am in the early stages of learning. We are given video lessons, but if you have questions, you can write to the teacher. After each topic there are homework assignments - the teacher checks them manually and then tells you what to correct. When the result is satisfactory, you can move on to the next lesson.

At the beginning, the assignments seemed boring to me because the course starts from the very basics and is aimed at people who know nothing about programming. The first homework is very simple - you need to display some values ​​or calculate something. But with each lesson, the tasks become more complicated and tasks appear in which you can show your imagination.

I find that topics such as variables, loops, and conditions are easy for students without programming knowledge to master. But it can get tough when object-oriented programming starts.

But teachers are interested in students understanding everything. Sometimes they even show cartoons in class to explain difficult moments. This, of course, seems funny to me, but if it is unclear and difficult for students, then this approach can help.

I have no plans to use Python in practice yet, because I have no plans to quit my job. I saw this course as a refresher for my brain to remember programming: no matter what the language, the basics are the same, and there is something to remember. But, of course, I wouldn’t want to finish the course and completely forget about Python: it’s a really cool language.

Python is the second most popular programming language in the world. A practical 4-month Python programming course with an individual mentor is suitable for those who want to learn the basics of programming in a universal, understandable and concise language.

  • More than 80 video lessons in 16 modules.
  • Checking everyone homework teacher.
  • Certificate of completion of the course.

Python is universal language high level that can be extended and embedded. For example, it is included in the application package as a tool for writing macros. Python does it smart choice for many programming tasks, large and small, and not so successful for a small number of computing tasks.

Where is the best place to use it?

The Python language is ideal for projects that require rapid development. It supports multiple programming paradigms, which is good for programs that require flexibility. And the presence of many packages and modules provides versatility and saves time.

Guido van Rossum is the creator of Python, affectionately honored by the community with the title of “benign dictator for life.” In the late 1980s, Guido liked the features of some programming languages, but none of them had all the features he wanted. In particular, the language had to have the following characteristics.

Scripting language

A script is a program that controls other programs. Scripting languages ​​are suitable for rapid development and prototyping because they are good at passing data from one component to another and freeing the programmer from hassle-free things like memory management.

The user community prefers to call Python a dynamic programming language.

Indentation for grouping statements

Python determines whether expressions belong to the same group using indentation. This group is called a code block. Other languages ​​use different syntax or punctuation for this. For example, in C the symbol ( denotes the beginning and ) is the end of a sequence of commands. Indentation is considered good practice in other languages, but one of the first to enforce indentation was Python. What does this give? Indentation makes code easier to read, and code blocks require fewer start and end marks and punctuation marks that can be accidentally missed. All this leads to fewer errors.

High Level Data Types

Computers store data in ones and zeros, but people need more complex forms, such as text. A language that supports complex data is said to support high-level data types. These types of data are easy to manipulate. For example, in Python, strings can be split, concatenated, converted to upper or lower case, searched, etc. High-level data types such as lists and dictionaries, which can store other data, have much more functionality than other languages.

Extensibility

The extensible programming language can be extended. Such languages ​​are very powerful because the extensions make them suitable for a variety of applications and operating systems. Extensions can add either concepts, modules, or plugins. The Python language is extendable in several ways. A core group of programmers works to change and improve it, and hundreds of others write modules for specific purposes.

Interpretation

Interpreted languages ​​are executed directly from source code written by humans, while programs written in compiled languages ​​such as C++ must be translated into slower languages ​​since translation occurs on the fly, but writing programs and debugging them is faster since there is no need to wait for the compiler to complete. They are easier to port to different platforms.

It is debatable whether Python is an interpreted or compiled language. Although it runs interpreted in many respects, its code is compiled before execution (like Java), and many of its components run on full speed machines, since they are written in C.

Guido began writing Python over the Christmas holidays in 1989, and over the next year he refined the language based on feedback from his colleagues. The general public saw the result in February 1991, when it was posted on a Usenet newsgroup.

In order to start writing programs in Python, you need to install it. Python 2.7 and Python 3.5 have significant differences that make programs written in them incompatible.

Macintosh computers have this language pre-installed, and its version depends on the age of the OS. If you're using Windows, you'll have to install Python yourself. Files installation package you can choose from python.org.

Two ways to interact

One of the reasons why programming in Python is so easy is that it comes with tools to help you design, write, and debug programs.

In interactive mode, commands are entered one line at a time, much the same as operating system(shell) accepts commands from the command line. You can also create short multi-line programs or import code from text files or built-in Python modules. For beginners, it will be helpful to know that the interactive mode includes an extensive help system. This convenient way exploring the capabilities of a programming language.

The IDLE development environment includes an interactive mode and tools for writing and running programs, as well as a name tracking system. The environment is written in Python and demonstrates the extensive capabilities of the language.

Interactive mode

Here you can do almost everything that can be done in a program, even write multi-line code. This mode can serve:

  • sandbox for safe experiments;
  • an environment that allows you to learn Python programming;
  • tool for finding and fixing errors.

Interactive mode can be used as a calculator, manipulate text, and assign values ​​to variables. You can also import modules, functions or parts of programs to test them. It helps to experiment with Python objects without writing long programs and debug programs by importing parts of them one at a time.

Working interactively

After launching Python, the terminal window will display information about the current version of the program, its release date, and several hints further actions and the >>> input prompt.

To work interactively, type a command or expression and press Enter.

Python interprets the input and will respond if what you typed requires an answer or if the interpreter doesn't understand it.

The following command will print the string. Since the printing location is not specified, the output occurs on the screen.

  • >>> print "Hello, world!"
  • Hello World!

This single line is the entire program! In interactive mode, Python processes each line of code entered after the enter key is pressed, and the result appears below.

Viewing information about an object

In interactive mode, there are two ways to view information about an object:

  • enter the object (or its name) and press the enter key;
  • enter the print command and the object (or its name) and press Enter.

The result depends on the object.

When using some data types (integers and lists, for example), these two methods give the same result:

  • >>> x =
  • >>> x
  • >>> print x

For strings, the result of typing "print name" is slightly different from the result of typing the name. In the first case the value is enclosed in quotes, but in the second it is not:

  • >>> x = "MyString"
  • >>> x
  • "MyString"
  • >>> print x
  • MyString

When the name refers to a block of code (such as a function, module, or class instance), entering the name will provide information about the data type, name, and storage location.

The following example creates a class named Message and displays information about

  • >>> class Message:
  • ... pass
  • >>> Message
  • >>>print Message
  • __main__. Message

Strings

In Python, strings are sequences of characters. A string literal is created by enclosing characters in single ("), double ("), or triple (""" or """) quotes. The following example assigns a value to the variable x:

  • >>> x = "MyString"

Python string has several built-in capabilities. One of them is the ability to return a copy of yourself with all of these capabilities are known as methods. To call a method on an object, you must use dot syntax. That is, after entering the name of the variable, which in this case is a reference to the string object, you need to put a dot operator (.), and then the name of the method, followed by an opening and closing parenthesis:

  • >>> x.lower()
  • "mystring"

You can get part of a string using the indexing operator s[i]. Indexing starts at zero, so s returns the first character in the string, s returns the second, and so on:

  • >>>x
  • >>>x

String methods work with both regular lines, and with Unicode. They perform the following actions:

  • change case (capitalize, upper, lower, swapcase, title);
  • count(count);
  • changing the encoding (encode, decode);
  • search and replace (find, replace, rfind, index, rindex, translate);
  • check the fulfillment of conditions (startswith, endswith, isalnum, isalpha, isdigit, islower, isspace, istitle, isupper);
  • combine and divide (join, partition, rpartition, split, splitlines);
  • format (center, ljust, lstrip, rstring, rjust, strip, zfill, expandtabs).

Python: lists

While Python strings are limited by characters, lists are not limited in any way. They represent ordered sequences of arbitrary objects, including other lists. In addition, you can add, remove and replace their elements. A series of objects separated by commas inside is what it represents, shown below - here are examples of data and operations with it:

  • >>> bases = ["A", "C", "G", "T"]
  • >>>bases
  • ["A", "C", "G", "T"]
  • >>> bases.append("U")
  • >>>bases
  • ["A", "C", "G", "T", "U"]
  • >>> bases.reverse()
  • >>>bases
  • ["U", "T", "G", "C", "A"]
  • >>>bases
  • >>>bases
  • >>> bases.remove("U")
  • >>>bases
  • ["T", "G", "C", "A"]
  • >>> bases.sort()
  • >>>bases
  • ["A", "C", "G", "T"]

In this example, a list of individual characters was created. Then an element was added to the end, the order of the elements was reversed, the elements were retrieved by their index position, the element with the value "U" was removed, and the elements were sorted. Removing an element from a list illustrates a situation where the remove() method needs to provide additional information, namely the value to be removed.

In addition to methods like remove(), Python has another similar feature called a function. The only difference between a function and a method is that the former is not associated with a specific object.

Python: functions

Functions perform actions on one or more values ​​and return a result. A large number of them are built into Python. Examples of built-in functions:

  • len() - returns the number of elements in the sequence;
  • dir() - returns a list of strings representing the attributes of the object;
  • list() - returns a new list initialized from some other sequence.
  • >>> help(round)
  • Help on built-in function round:
  • round(...)
  • round(number[, ndigits]) -> floating point number

It is also possible to define your own functions.

User Defined Functions

The process for creating your own Python function is as follows. The first line starts with keyword def followed by the function name and arguments (expected input values) enclosed in parentheses and ending with a colon. Subsequent commands form the body of the function and must be indented. If a comment appears at the beginning of a function's body, it becomes part of its documentation. Last line function returns the result:

  • >>> def transcribe(dna):
  • ... """Return dna string as rna string."""
  • ... return dna.replace("T", "U")
  • >>> transcribe("CCGGAAGAGCTTACTTAG")
  • "CCGGAAGAGCUUACUUAG"

In this example, a function called transcribe was created that expects a string representing a DNA sequence. The replace() method returns a copy of the original string with all occurrences of one character replaced with another. Three lines of code allowed DNA to be transcribed into RNA. looks like that:

  • >>> def reverse(s):
  • ... """Return the sequence string in reverse order."""
  • ... letters = list(s)
  • ... letters.reverse()
  • ... return "".join(letters)
  • >>> reverse("CCGGAAGAGCTTACTTAG")
  • "GATTCATTCGAGAAGGCC"

The reverse function takes a string, creates a list based on it, and reverses its order. Now we need to do the reverse transformation. The object has a join() method that joins a list by separating each element with a string value. Since the delimiter is not needed, the method is used on empty line, represented by two quotation marks ("" or "").

Dictionaries

A Python dictionary- What is this? It has the same advantages as a regular paper dictionary. Allows you to quickly find the desired value (definition) associated with a key (word). Dictionaries are enclosed in curly braces and contain a comma-separated sequence of key-value pairs. Dictionaries are not ordered. Instead, dictionary values ​​are accessed through their key rather than their position.

  • >>> basecomplement = ("A": "T", "C": "G", "T": "A", "G": "C")
  • >>> basecomplement.keys()
  • ["A", "C", "T", "G"]
  • >>> basecomplement.values()
  • ["T", "G", "A", "C"]
  • >>> basecomplement["A"]

Classes

In order to create your own objects, you need to define a kind of template called a class. In Python, this is done using the class statement, followed by the name and a colon. The body of a class definition contains properties and methods that will be available to all instances of objects based on that class.

Advantages

Most programming languages ​​offer convenience features, but none have the combination of convenience and power that Python offers. What are these benefits? Here are some of them:

  • The language can be embedded in other applications and used to create macros. For example, in Paint Shop Pro 8 and above later versions it is a scripting language.
  • Python is free to use and distribute, commercially or not.
  • The language has powerful text processing and search capabilities, which is used in applications that work with large amounts of text information.
  • You can build large applications on it without having to check the programs you're running.
  • Python supports testing and debugging individual modules and entire programs.

For some time now, the thought has been swirling in my head about whether I should write a short note on the topic of why the Python programming language is worth learning, and moreover, creating software projects in it.

Some of you know that I recently attended the biggest event in the community Python programmers- . All expenses were covered entirely by me without the involvement of sponsors or employers. Perhaps, to attend such an event, you need to have some emotional attachment to the subject, and this is true.

What is Python?

Python is a general-purpose programming language aimed primarily at increasing the productivity of the programmer himself, rather than the code he writes. In simple human language, you can write almost anything in Python (web/desktop applications, games, automation scripts, complex calculation systems, life support control systems and much more) without any significant problems. Moreover, the barrier to entry is low, and the code is largely concise and understandable even to those who have never written in it. Due to the simplicity of the code, further maintenance of programs written in Python becomes easier and more enjoyable compared to Java or C++. And from a business point of view, this entails a reduction in costs and an increase in employee productivity.

To demonstrate brevity, let's look at the Python and Java code that opens a file and stores its contents in a variable:

File = open("file.txt") content = file.read()

Import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; public static void main(String args) throws IOException ( String content = new String(Files.readAllBytes(Paths.get("file.txt"))); )

The Java code uses an updated interface to work with the input/output system. The old way would look even worse :)

Who uses Python?

Even the most advanced programming language is worthless if no one cares about it. One of the components of the success of any technology is the community created around it. It is this that predetermines the future vector of development through joint efforts. The Python community is one of the strongest in the IT world. This is a complex, well-organized and constantly developing organism. In addition to hundreds of thousands of individual developers and small software companies, Python is supported by such IT giants as:

And many many others. Impressive, isn't it? As for large and popular projects written in Python, these are such monsters as:

  • YouTube (most of the codebase is entirely in Python)
  • The first version of the Google search spider was written in Python, and later, due to the extremely high load and speed requirements, was rewritten in C++.
  • Dropbox desktop client
  • Reddit
  • Instagram (500M Python users)
  • Bitbucket (Python 2.7 and Django 1.7.11)
  • EVE Online MMOPPG
  • Quora
  • Spotify
  • Critical PayPal services, processing up to 2 billion requests per day. You can find out more in the TalkPython podcast, episode #54
  • Mozilla Services
  • Popular service Pinterest ideas
  • Disqus comment service (I use it on this blog, the service is implemented in Django)
  • Domestic Facebook services(see poster in mine)
  • Mercurial version control system (until some time ago, Python developers used it in their work)
  • Wargaming services

and I'm sure there are many other interesting and popular applications, which I forgot to list here (welcome in the comments).

What does this mean? About many things. And the most important thing is that large corporations are not afraid to build their business around Python, they are confident that the technology will survive, and therefore they should not expect problems with finding specialists. Moreover, the variety of applications is also impressive, demonstrating the wide range of problems that Python solves masterfully.

In a note about the book "", I wrote that it was taken as a basis as educational material for an introductory programming course at MIT, computer language at that time the Lisp dialect was Scheme. Times are changing, now what is leading as a digital lingua franca...? That's right, Python. It is used as a reliable tool in such an amazing craft.

Python Disadvantages

A reader unfamiliar with Python may have the impression that it is a panacea for all ills, a silver bullet and a cure for cancer. But not everything is so rosy and wonderful. Like everything, Python has a number of its own shortcomings, which can sometimes be critical and influence the choice not in favor of the snake.

Speed

One of the main disadvantages is its relatively low speed execution. Python is a fully dynamically typed language, automatic control memory. While at first glance this may seem like an advantage, when developing programs with increased efficiency requirements, Python can be significantly slower than its static brothers (C/C++, Java, Go). As for its dynamic counterparts (PHP, Ruby, JavaScript), things are much better here; Python in most cases executes code faster due to pre-compilation to bytecode and a significant part of the standard library written in C. At conferences I had the opportunity to communicate with guys from large companies like Wargaming, many of them have a trend of moving towards statics, and most often this is Go, Rust.

An interesting report about the speed and optimization of CPython (native implementation of the language in C) was read at PiterPy 2015 in St. Petersburg:

Dynamic typing

For novice programmers, a dynamically typed programming language at first glance (and at the second and even at the third) may seem like an outlet, a heavenly pleasure, especially for those who have previously dealt with “statics”. But there is also back side moon. As the code base grows (and this is often an inevitable process in successful projects), it can be very difficult to keep track of the type of data transferred to each other (and in the absence of clear documentation and tests), this is where problems arise when, for example, they try to call a method on None or access an attribute during code execution. To solve this kind of problem, dynamic languages ​​are overgrown with all sorts of crutches, whistles and tricks in the form of type annotations, mypy projects for static code analysis, and so on. This, in turn, puts a negative connotation on the aesthetic side of the code.

Due to language limitations, alternative implementations of interpreters appear: PyPy, Pyston, Jython, Cython and many others. Now the trend is clearly visible in this direction, for example, Pyston is being developed within the walls of the so-called. Mecca of Python programmers - Dropbox :)

Conclusion

Despite a number of problems historically inherent to Python, it continues to be a leading tool in a number of niches:

  • Web application development (here we have the undisputed leader in the form of Django).
  • Data analysis and machine learning(scipy, scikit-learn, pandas, numpy packages recognized by the global scientific community).
  • Introduction to programming (pygame, turtle are good at motivating children to start coding).
  • Rapid prototyping of ideas in business due to the abundance of ready-made libraries, a low barrier to entry into the language and high productivity of programmers writing in Python.
  • Writing scripts (scenarios) to automate tasks. Python comes by default with all distributions of unix-like systems and is an excellent replacement for Bash in every sense.

I'm sure I forgot something else. In general, Python rules!

Links

  • Excellent report about GIL(Global Interpreter Lock). GIL is one of the serious bottlenecks in Python on the way to parallel programming.
  • Guido van Rossum's talk about type annotations at last year's PyCon US.
  • Raymond Hettinger at last year's PyCon read an excellent report on the topic of the pythonic approach to writing code, showing how to transform Java-like into Python-like code. Unconditional must watch.
  • Post in technical Instagram blog about how they handle workloads using Python and Django.
  • 10 Myths of Enterprise Python on the PayPal Blog.

If you are looking for an answer to the question: “Which programming language to choose first,” then in about 90% of all cases you will be offered Python - as the easiest language to learn. And it is obvious that a certain number of people who have not learned programming before will choose Python because of these recommendations. And here we have a problem, which will be discussed below. Of course, with a description of how I got to this life.

About Me

Even during my student years, I realized that my specialty was not as rosy as it seemed to me at 18 years old. So I started thinking about how to earn adequate money. And after listening to stories about how my cousin received crazy money at that time in 1C, I also decided to connect my life with IT.

Initially, these were template sites using website builders and WordPress, then I got involved in SEO, and at one point came across Habr, after which I decided to become a full-fledged programmer. I didn’t have higher mathematics, so I decided to choose a field where it was not required - web development.

I had an obvious question: which language to choose - php/python/ruby. Having seen enough articles on Habré, I read some hate towards php after watching a couple of motivational videos from Yandex. I chose Python. I hope you know the advantages of language, so I won’t talk about it.

Primary language training

I combined language learning with my main job, so I read books, watched tutorials, and worked on small projects in the evening. In general, in a year I

1) Studied books:

  • Mark Lutz - Learning Python
  • Mark Lutz - Python Programming
  • Chad Fowler – Programmer Fanatic
  • Bill Lubanovich - Simple Python
2) Studied a lot of videos from Ukrainian/Bourgeois authors on Django
3) Completed a course from codeacademy
4) Mastered PyCharm

Your first project

Then I had the idea of ​​a small service on a very specific topic, which I decided to create in order to consolidate my knowledge of Python + Django.

In creating the site I

1) Studied books:

  • John Duckett - HTML and CSS. Website development and design
  • David Flanagan - JavaScript. Detailed Guide
  • Ben Forta - Learn SQL on your own.
2) I studied the Django documentation for my tasks
3) I studied the deployment of projects on Django Gunicorn + nginx + centOS

My first normal project

After the first adequate website failed, I decided to create something worthwhile, chose an idea, chose an implementation scheme, and completed it in the evenings in 3 months.

The project has shown its viability (to this day it brings me some money, which I am incredibly happy about). And I decided to pump it up better.

After reading the book “Percival H. - Test-Driven Development with Python,” I decided to write tests first based on Django components, then looked up the Selenium documentation, and already made external tests.

I want to be cool

Having opened vacancies for Python-Django developers, I looked at what else is usually required in such vacancies:
  • Django Rest Framework
  • Celery
  • Tornado/Twisted/asyncio (Choose one)
  • Class-based view Django
  • Angular/React (Choose one)
Spent 3 months getting to know/trying these things. I also picked up the Python standard library + external parsing library beautifulSoup.

You can't work without C/C++

There is an opinion that without knowledge of C/C++, a programmer cannot call himself a programmer. So when I had free time, I got acquainted with the books:
  • Brian Kernighan – C Programming Language
  • Stanley B Lippman – C++ programming language. Basic course
I read the books, tinkered with the code, looked at the compilation, looked at the code examples. In general, now I didn't big eyes when mentioning links, pointers, sorting, OOP and a bunch of different arrays with at different speeds processing an element depending on its position.

I'm ready to fight!

And here we come to the most important point. Having spent a total of 2 years learning all the elements of web programming that I mentioned above. I considered myself ready enough to apply for a position as a Python web developer. Of course, I didn’t know some things very well, some superficially, and some I didn’t know at all (for example, Flask), but the general understanding and skills were quite good.

And here the problems with Python began, which people most often do not focus on. Namely, on the business demand for junior/pre-middle level Python developers.

I entered the market with this question.

Although at first glance it seems that there are quite a lot of vacancies in Python, when the specifics begin, everything changes dramatically.

1. Immediately there is a large screening of vacancies where Python is exclusively an auxiliary language. Most often these are positions of Java developers, System Administrators,QA-Automation. Also, there is now a large dropout in Data Learning, which requires a math education + the R language. With Python alone you won’t be able to find this vacancy.

2. It turned out that in my city there are no vacancies for Python, literally none at all. Having expanded the search throughout the area, I also received unsatisfactory results. A couple of vacancies in PHP, where Python was a plus. When I opened the filter for the last 3 years, I also discovered that there were no vacancies for Python at all. Those. businesses in the provinces most often choose simpler and more popular technologies than Python.

3. Having opened Python vacancies in a general search engine, I discovered the following trends:

  • 90%+ of vacancies are located in Moscow or St. Petersburg
  • 90%+ of vacancies require middle+ / senior level
  • ~100% of vacancies for junior positions in Moscow or St. Petersburg (most often from giants)
In other words, the situation has turned out that if you do not live in Moscow, St. Petersburg and are not going to go to “conquer” them, then you have practically no place to get your first job.

Of course, there are a couple of places where Python is still used, for example, in Kazan. But most often this is one company, where the vacancies are also very middle+ / senior.

4. The option of searching for remote work at the current level also showed that employers are not ready to take such a risk. Little experience + remote work = this is some kind of fantasy.
Nevertheless, I was still able to find a couple of options, but already during the initial interview it became clear that this was nonsense like: “You work for us for three months, and if the client pays for your work, we will pay you too.” Not the best option.

5. I spoke with a couple of HR from large companies, they expressed this trend. “We usually hire people with at least a year of experience in Python, plus experience in another language (3+ years). Most often php/Java." In other words, they didn't consider hiring someone with just Python at all.

6. After talking with the guys from specialized forums, it became clear that this is enough typical situation. From their stories, it became clear that people, after a futile search, either went to work on PHP/1c, or somehow climbed through upwork/own project/test automation.
But again, from case to case.

In general, it turned out that Python is an excellent language that allows you to create powerful projects. And it just so happens that their concentration is in the capitals. And since these are complex projects, then employees are required at the middle+ level. Is a person who has just learned Python ready to get such a vacancy? Difficult!

But there is another way!

IN currently in my city alone there are 24 vacancies for php various levels(ranging from small companies that need to maintain a current website, to e-commerce giants that offer serial expansion functionality). And about the same number of vacancies for 1C. And in about half of these vacancies they are ready to hire a person who at least knows something about programming. Most likely, these are not the best places, but this is the first job after which you will officially become an experienced programmer for HR.

So in the end

It turns out that you can learn the cool programming language Python and stay on the street. Or you can learn the “hated” php/1c and get a job. The quality of this work, of course, leaves many questions - but this is already experience.

As for me, in my conditions (not going to Moscow/St. Petersburg), I actually spent time learning a language that is now in demand exclusively in my own projects. I was unable to find work locally or remotely. Now I’m moving towards php, since it simply has work.

Therefore, if you do not live in Moscow, St. Petersburg, or are not a student at a technical university, then I would not advise you to learn Python as your first language. Pay attention to PHP - there are always places for it, there is work, there is experience. And the further path of development is already yours.

P.S. As my friend told me, the situation is almost the same in Ruby. But here I can no longer speak with confidence.