Python Array Bisection Algorithm

George John
Published on 31-Oct-2018 11:36:14
The bisect algorithm is used to find the position in the list, where the data can be inserted to keep the list sorted. Python has a module called bisect. Using this module, we can use bisect algorithms. To use this module, we should import it using − import bisect ... Read More

Python Heap Queue Algorithm

Chandu yadav
Published on 31-Oct-2018 11:32:37
The heap data structures can be used to represents a priority queue. In python it is available into the heapq module. Here it creates a min-heap. So when the priority is 1, it represents the highest priority. When new elements are inserted, the heap structure updates. To use this module, ... Read More

Python Abstract Base Classes for Containers

Ankith Reddy
Published on 31-Oct-2018 11:29:25
There are some abstract base classes for the Python containers. There are different abstract base classes. These classes are like Containers, Hashtable, Generator, Set, MutableSet, Awaitable etc.To use this module, we should import it using −import collections.abcSome Abstract Base Classes are there, which are very useful. These classes are used ... Read More

Python Container Datatypes

Arjun Thakur
Published on 31-Oct-2018 11:24:36
In the collections there are some container datatypes, which are alternatives to python’s general purpose built-in containers like dict, list, set etc.Some of the containers are −Sr.No.Container & Description1namedtuple()Used to create tuple subclass with the name field2dequeQueue using list type data3CounterSubclass of dict to count the hash-table objects4ChainMapUsed to create ... Read More

Python Container Datatypes

Published on 08-May-2019 14:17:35
Among Python’s built-in types, list, tuple and dict are known as container data types. The collection module provides some more specialized alternatives to built-in types by improvising them.CounterThe Counter class is subclassed from built-in dict class. Object of Count class is a key-value pair. Key is an element in sequence ... Read More

Python Basic date and time types

George John
Published on 31-Oct-2018 11:17:48
To manipulate dates and times in the python there is a module called datetime. There are two types of date and time objects. The types are naïve and the aware. In the naïve object, there is no enough information to unambiguously locate this object from other date-time objects. In this ... Read More

Python Completion function for GNU readline

Arjun Thakur
Published on 31-Oct-2018 11:13:47
Unix readline module has tab completion mechanism. To get these features, we have to use rlcompleter module. It can be used in python’s interactive mode. To use this module, we should import it using − import rlcompleter There is a class called Completer class − Method Completer.complete(text, ... Read More

Python Helpers for Computing Deltas

Ankith Reddy
Published on 31-Oct-2018 11:09:25
To compute deltas, we should use the difflib module of python. This module has different classes and functions to compare sequences. It can compare files, HTML files etc. To use this module, we need to import the difflib module in the python code. import difflib Some classes and ... Read More

Python GNU readline Interface

Chandu yadav
Published on 31-Oct-2018 11:03:21
The readline is UNIX specific module. It defines a number of functions to read and write history files in easier way from python interpreter. We can use this module directly or using the rlcompleter module. This module settings may affect the built-in input() method prompt and also the interactive ... Read More

Python Internet String Preparation

Ankith Reddy
Published on 31-Oct-2018 10:59:12
To identify different things in the internet, it is necessary to compare different identification for equality. The comparison procedure depends on the application domain. For an example, some things are case-insensitive etc. To check these kind of information stringprep is used. The RFC 3454 defines the procedure to prepare the ... Read More