Python tutorials

Python Nested Functions

What is a Nested Function? Functions are one of the “first-class citizens” of Python, which means that functions are at the same level as other Python objects like integers, strings, modules, etc. They can be created and destroyed dynamically, passed to other functions, returned as values, etc. Python supports the concept of a “nested function” or “inner function”, which is simply a function defined inside another function. In the rest of the article, we will use the word “inner function” […]

Read more

Intro to the Python Random Module

Introduction Even for someone not interested in computer programming, the usefulness of generating random numbers in certain circumstances is something obvious. In most board games we throw dice to generate an unpredictable number that defines the player’s next move. Also, we can all agree that playing any card game would be pointless without a proper shuffle between rounds. But random numbers are not only important in relatively trivial fields like entertainment or gambling. They’re especially crucial in the field of […]

Read more

Using Plotly Library for Interactive Data Visualization in Python

In my previous article, I explained how the Pandas library can be used for plotting basic and time series plots. While Pandas, Matplotlib, and Seaborn libraries are excellent data plotting libraries, they can only plot static graphs. Static plots are like simple non-interactive images. In most of the cases, static plots are enough to convey the information. However, in some cases you may like to add user interactivity to your plots. In this article, we will see how the Python’s […]

Read more

Course Review: Hands On Computer Vision with OpenCV & Python

Introduction In this article I will be providing a review of the Udemy course Hands On Computer Vision with OpenCV & Python by Shrobon Biswas featured on the Udemy online learning site. At the time of this writing I would say that the course is moderately successful with a total of 146 ratings averaging to 4.1/5 stars along with a total enrollment of 851 students. According to the description, this course is introductory in nature and geared towards novice to […]

Read more

Automating AWS EC2 Management with Python and Boto3

Introduction In this article I will be demonstrating the use of Python along with the Boto3 Amazon Web Services (AWS) Software Development Kit (SDK) which allows folks knowledgeable in Python programming to utilize the intricate AWS REST API’s to manage their cloud resources. Due to the vastness of the AWS REST API and associated cloud services I will be focusing only on the AWS Elastic Cloud Compute (EC2) service. Here are the topics I will be covering: Starting an EC2 […]

Read more

Introduction to Python’s Collections Module

Introduction Collections in Python are containers that are used to store collections of data, for example, list, dict, set, tuple etc. These are built-in collections. Several modules have been developed that provide additional data structures to store collections of data. One such module is the Python collections module. Python collections module was introduced to improve the functionalities of the built-in collection containers. Python collections module was first introduced in its 2.4 release. This tutorial is based on its latest stable […]

Read more

Python Context Managers

Introduction One of the most “obscure” features of Python that almost all Python programmers use, even the beginner ones, but don’t really understand, is context managers. You’ve probably seen them in the form of with statements, usually first encountered when you learn opening files in Python. Although context managers seem a little strange at first, when we really dive into them, understand the motivation and techniques behind it, we get access to a new weapon in our programming arsenal. So […]

Read more

Introduction to Python Iterators

What are Iterators? An iterator in Python refers to an object that we can iterate upon. The iterator consists of countable values, and it is possible to traverse through these values, one by one. The iterator simply implements the Python’s iterator protocol. The iterator protocol is a Python class which comes with two special methods, namely __iter__() and __next__(). With these two methods, the iterator is able to compute the next value in the iteration. With iterators, it is easy […]

Read more

Dockerizing Python Applications

Introduction Docker is a widely accepted and used tool by leading IT companies to build, manage and secure their applications. Containers, like Docker, allow developers to isolate and run multiple applications on a single operating system, rather than dedicating a Virtual Machine for each application on the server. The use of these more lightweight containers leads to lower costs, better resource usage, and higher performance. If you’re interested in reading more, you should take a look at Docker: A High […]

Read more

Getting Started with MySQL and Python

Introduction For any fully functional deployable application, the persistence of data is indispensable. A trivial way of storing data would be to write it to a file in the hard disk, but one would prefer writing the application specific data to a database for obvious reasons. Python provides language support for writing data to a wide range of databases. Python DB API At the heart of Python support for database programming is the Python DB API (PEP – 249) which […]

Read more
1 135 136 137 138 139 167