This article summarizes the most important Python topics and provides links and summary information to more detailed articles on our site. We hope you bookmark this page for future reference.
Python is free and open source, available for all operating systems from python.org. If not already installed, this article will help you with your python setup.
IPython is a interpreted language which means that the code is translated
(interpreted) to binary code while the program runs.
To run Python code you need to have a Python interpreter. There are different
versions of Python, either Python 2 or Python 3.
In Python, variables are a storage placeholder for texts and numbers.
The Python interpreter is usually installed in /usr/local/bin/python on machines
where it is available.
When working with any programming language, you include comments in the code to notate your work.
This details what certain parts of the code are for, and lets other developers know what you were up to when you wrote the code.
Python documentation strings (or docstrings) provide a convenient way of associating documentation with Python modules, functions, classes, and methods.
Keywords in Python are reserved words that cannot be used as ordinary
identifiers. They must be spelled exactly as they are written.
Boolean values are the two constant objects False and True.
They are used to represent truth values (other values can also be considered
false or true).
Python includes the +, -, *, /, % (modulus), and ** (exponentiation) operators.
Regular Expressions are a string pattern written in a compact syntax, that allows us to quickly check whether a given string matches or contains a given pattern.
The Python distribution includes the Python interpreter, a very simple development
environment, called IDLE, libraries, tools, and documentation.
In this post we will cover how Python handles errors with exceptions.
A string is a list of characters in order.
One common task you’ll need to accomplish with any language involves merging or combining strings. This process is referred to as concatenation.
The best way to describe it is when you take two separate strings – stored by the interpreter – and merge them so that they become one.
The simplest data structure in Python and is used to store a list of values.
Lists are collections of items (strings, integers, or even other lists).
Dictionaries are collections of items that have a “key” and a “value”.
Methods of Dictionary Objects
Methods of String objects
Methods of List objects
To keep a computer doing useful work we need repetition, looping back over the same block of code again and again.
List comprehensions provide a concise way to create lists.
A function is something you can call (possibly with some parameters, the things you put in the parentheses), which performs an action and returns a value.
In programming, very often we want to check the conditions and change the
behavior of the program.
Conditions tests if a something is True or False, and it uses Boolean values
(type bool) to check that.
Python modules makes the programming a lot easier. It’s basically a file that consist of already written code.
Pillow is a fork of PIL (Python Image Library), started and maintained by Alex Clark and Contributors. It was based on the PIL code, and then evolved to a better, modern and more friendly version of PIL. It adds support for opening, manipulating, and saving many different image file formats. A lot of things work the same way as the original PIL.
When you’re working with Python, you don’t need to import a library in order to read and write files. It’s handled natively in the language, albeit in a unique manner.
In Python you need to give access to a file by opening it. You can do it by using the open() function. Open returns a file object, which has methods and attributes for getting information about and manipulating the opened file.
This style guide is a list of dos and don’ts for Python programs.
PEP8 has emerged as the style guide that most projects. it promotes a very readable and eye-pleasing coding style.
IPython is an interactive shell for the Python programming language that offers
enhanced introspection, additional shell syntax, tab completion and rich
Recommended Python Training
For Python training, our top recommendation is DataCamp.