How Do I Remove All Packages Installed By Pip?

In this post, we will learn more about How to remove all packages installed by pip which we can perform using a fixed number of steps by following the commands and directions given there and executing the where we can also perform the same even uninstall pip setuptools which will help in removing both pip … Read more

Docstrings | What Are The Most Common Python Docstring Formats?

In this post, we will learn more about the most common Python docstrings formats which it is used for documenting the functions, classes, and modules in python, Which are defined in triple quotes which say string enclose and provide critical information about how to see the code. Docstring As there are a number of formats … Read more

How To Print Numbers Using Commas As Thousands Separators?

In this post, we will learn more about How to print a Numbers using commas as thousands of separators where we can use the format method along with “{:,.0f}” which is a format of the string. Numbers Using Commas Using commas in digits makes it easy for us to understand the digit and read the … Read more

How To Parse XML And Get Instances Of A Particular Node Attribute?

In this post, we will learn How to parse XML and get instances of a particular node attribute which we are going to do with the element tree module which is a standard library. Parse The XML File As there we are going to parse and get instances of a Particular node and for implementing … Read more

What Is A Cross-Platform Way The Get The Home Directory?

In this post, we will learn What is a cross-platform way to get the home directory which we can perform using ‘os. path. expander user() function to get it done and to get the path of the current user, And the same method is known as the cross- platform method which has an advantage as … Read more

How Do I Sort A List Of Objects Based On An Attribute Of The Objects?

In this post, we will learn How to Sort a list of objects based on an attribute of the objects which we can perform using the sort built in function even we can do the same thing using the sorted function to and here we will discuss both the examples and execution with the help … Read more

What Are “named tuples” in Python?

In this post, we will learn more about What “named tuples” in Python it is nothing but a subclass of a regular tuple with a limitation as it has a fixed set of fields and there each field has a name. Which makes it easy to navigate and access the data and an intuitive way … Read more

slots | What is the Usage of __slots__?

In this post, we will get to know more about the Usage of __ slots__ in Python where slot is a class variable that has flexibility as it allows us to explicitly declare the attributes that have an instance as the class can have, which leads for reducing the memory footprint and improving performance.  Slots … Read more

Exception | How Do You Test That A Python Function Throws An Exception?

In this post, we will learn How to test that a Python function throws an Exception where we can use the assert raises method from the in built module called the ‘unit test’ module which we can directly import from the library. Catching Exception Here we have given an example where we can see how … Read more

How Can I Install Packages Using pip According to The Requirements.txt File From A Local Directory?

In this post, we will learn How can I Install packages using pip according to the requirements.txt file from a local directory where for installing the new package using pip though (terminal in case of Linux) and command prompt in case of the window according to the requirement we use ‘-r’ package. Install The Package … Read more

%d bloggers like this: