Blog

Python Multithreading

Multiple tasks may need to be performed by a single process. These many tasks are separate operations that belong to the same process. These independent tasks can be called threads. An independent execution flow within a process is known as a thread. Multiple threads may be present in a single process. A process that is […]

Handle 404 Not Found Page in Django

This post shows how to customize your Django website’s 404 (not found) page. If the resource doesn’t exist, Django displays the standard 404 page in production mode (DEBUG = False). Django invokes a specific view that is added to handle 404 failures when the Http404 exception is raised in a view. Django’s handler404 view by […]

Python Decorators 

Decorators are a very powerful and useful tool in Python since it allows programmers to modify the behavior of a function or class without permanently modifying the callable itself. Function decorators take function references as arguments and wrap them in a wrapper before returning the function with the wrapper as a new function. Functions are […]

Python Generator Functions

Building an iterator in Python takes a lot of effort. We must create a class containing the methods __iter__() and __next__(), maintain track of internal states, and raise StopIteration when no values are to be returned. Please refer python iterators to know details. This is both lengthy and confusing. In such cases, the generator comes […]

Python Iterators

In Python, an iterator is an object that iterates over iterable objects such as lists, tuples, dicts, and sets. The iter() method is used to create the iterator object. It iterates using the next() method. The iter() function (which in turn calls the __iter__() method) returns an iterator from them. We use the next() function ( which in turn calls the  […]

Python List Comprehension

The python list and list compression features are two of the language’s most significant characteristics, which can be used to build powerful functionality with just one line of code. It’s a beautiful technique to make lists without using the for-loop construct. List comprehension allows you to generate a new list with just one line of […]

Python Map, Filter and Reduce

In this tutorial, you’ll learn about three of Python’s most powerful functions: map(), filter(), and reduce(). Functional programming paradigms include Map, Filter, and Reduce. They allow the programmer (you) to write simpler, shorter code by removing the need for complexity such as loops and branching. These are three functions that help with a functional programming […]

Python Lambda Functions

Python Lambda Functions are anonymous functions, which means they don’t have a name. The def keyword is used to define a typical function in Python, as we already know. The lambda keyword is also used in Python to define an anonymous function. Syntax : lambda arguments: expression This function can have any number of arguments […]

Python Shallow Copy and Deep Copy

In Python, assignment statements ( = ) create bindings between a target and an object, rather than copying them. A copy is sometimes required for mutable collections or collections that contain mutable elements, so that one copy can be changed without affecting the other. This module supports shallow and deep copy operations in general. Ex.: […]

File Handling in Python

Python, like many other programming languages, offers file management and allows users to read and write files, as well as perform a variety of other file-related tasks. Python processes files differently depending on whether they are text or binary, which is essential. A text file is formed by each line of code, which contains a […]

Scroll to top