DEV Community

Cover image for An Introduction to Python
Jordan Gregory for CodeTips

Posted on • Originally published at codetips.co.uk

An Introduction to Python

"Python is a programming language that lets you work more quickly and integrate your systems more effectively." - python.org

Python is an easy to read, easy to write, powerful general-purpose language. It is dynamically typed and interpreted.

The reason python is known as a general-purpose language is that it can be used in a large number of situations, and indeed is being used in a large number of situations; ranging from Web Development, Systems Development, High Performance and Scientific Computing tasks.

Python tends to have ebbs and flows of popularity, but as new technologies emerge (such as Machine Learning and Artificial Intelligence), python usually takes a front-seat because the language is so easy to use.

As python has been around since the early 1990's, the community is impressively large, and therefore, finding a package or library to perform specific tasks that you wish to accomplish is very easy.

There are several different distributions and versions of python currently being used. If you are reading this on a Mac, Linux, or Unix computer, it's likely that you already have Python version 2.7 installed; as this is a requirement on most common operating systems.

If you are using Microsoft Windows, you can install the language by visiting their downloads page.

There are three different distributions of python, depending on the type of problem you are trying to solve, certain distributions will be better suited. Here is a list of the most common python distributions:

  • Anaconda - "The open-source Anaconda Distribution is the easiest way to perform Python/R data science and machine learning on Linux, Windows, and Mac OS X." - https://www.anaconda.com/distribution/

  • IPython - "IPython provides a rich toolkit to help you make the most of using Python interactively." - https://ipython.readthedocs.io/en/stable/.

    • This is the interpreter used in the "data science famous" Jupyter Notebook application.
  • CPython - This is the default, vanilla version of python that you can download from https://www.python.org/downloads/

  • PyPy - "PyPy is a fast, compliant alternative implementation of the Python language (2.7.13 and 3.5.3, 3.6). It has several advantages and distinct features such as better speed, and better memory usage, among others." - https://www.pypy.org/

  • MyPy - "Mypy is an optional static type checker for Python that aims to combine the benefits of dynamic (or "duck") typing and static typing. Mypy combines the expressive power and convenience of Python with a powerful type system and compile-time type checking." - http://mypy-lang.org/

Once you have your Python interpreter of choice installed for your platform, simply open up your terminal and enter the following command to verify that you have a working python interpreter installed:

python --version

Note: If you have installed one of the other distributions of python, you may have to issue a different command to check the version, refer to your distributions documentation for more information.

To start writing Python all you need is a simple text editor. Python comes with its own editor, called Idle, which can be used by running idle in a terminal, or you can download and use another code editor ( we recommend Visual Studio Code ).

Once you have an editor installed, you are free to move on to our other Python articles and actually start writing some code.

If you get stuck and need some help, drop us a comment and we'll try to help you.

We've also set-up a Slack community to help people in more real-time. You can join us here.

Latest comments (0)