Sarika Singh has Published 72 Articles

How we can bundle multiple python modules?

Sarika Singh

Sarika Singh

Updated on 23-Nov-2022 07:00:12

2K+ Views

Working with complex programs that run for thousands of lines produces two fundamental problems arise – managing the code to know which functionality is implemented where and debugging the program in case of an error. Fortunately, both problems can be solved by breaking the code into multiple modules and then ... Read More

What is a file descriptor used in Python?

Sarika Singh

Sarika Singh

Updated on 14-Nov-2022 08:29:25

4K+ Views

File descriptors in Python are identifiers that represents the open files in the os kernel and are kept in a table of files. Typically, they have non-negative values. Negative results denote an error or a "no value" condition. They support a variety of file-related operations. In general, descriptors are a ... Read More

What does the 'b' modifier do when a file is opened using Python?

Sarika Singh

Sarika Singh

Updated on 14-Nov-2022 08:24:56

11K+ Views

If we open a file in oython using the b modifier. The file is opened in binary mode using the 'b' modifier. Any file whose format doesn't consist of readable characters is referred to as a "binary" file. Binary files include audio files like MP3s, text formats like Word or ... Read More

What are different data conversion methods in Python?

Sarika Singh

Sarika Singh

Updated on 14-Nov-2022 08:22:29

587 Views

Type conversion is the transformation of a Python data type into another data type. Implicit type conversion and explicit type conversion are the two basic categories of type conversion procedures in Python. We will cover the following topics in this article − Implicit Type Conversion in Python is carried ... Read More

How do I calculate the date six months from the current date using the datetime Python module?

Sarika Singh

Sarika Singh

Updated on 14-Nov-2022 08:09:49

1K+ Views

Python does not have a data type for dates, but we may import the datetime module to work with dates as date objects. This article tells about how to display the current date by importing the datetime module. Using relativedelta() function The relativedelta type is intended to be applied to ... Read More

How to disable logging from imported modules in Python?

Sarika Singh

Sarika Singh

Updated on 14-Nov-2022 08:02:06

17K+ Views

Applications can use the logging module to configure various log handlers and to route log messages to these handlers. This enables a very flexible design that can handle a wide range of use cases. A caller must first request a named logger in order to produce a log message. The ... Read More

What are the most useful Python modules from the standard library?

Sarika Singh

Sarika Singh

Updated on 14-Nov-2022 07:30:09

6K+ Views

The Python Standard Library is a collection of script modules that may be used by a Python program, making it unnecessary to rewrite frequently used commands and streamlining the development process. By "calling/importing" them at the start of a script, they can be used. A module is a file that ... Read More

How do we use equivalence (“equality”) operator in Python classes?

Sarika Singh

Sarika Singh

Updated on 23-Sep-2022 12:17:05

2K+ Views

Using comparison operators, we may compare various data types in Python. When creating custom classes, we are unable to simply compare them using the comparison operators. This article will go over various approaches to verify equivalence ("equality") in Python classes. Equality of class objects The == operator makes it simple ... Read More

What is a metaclass in Python?

Sarika Singh

Sarika Singh

Updated on 18-Aug-2022 12:50:11

3K+ Views

Metaprogramming in python is defined as the ability of a program to influence itself. It is achieved by using metaclass in python. Metaclasses in Python Metaclasses are an OOP concept present in all python code by default. Python provides the functionality to create custom metaclasses by using the keyword type. ... Read More

How to destroy an object in Python?

Sarika Singh

Sarika Singh

Updated on 18-Aug-2022 12:39:40

17K+ Views

When an object is deleted or destroyed, a destructor is invoked. Before terminating an object, cleanup tasks like closing database connections or filehandles are completed using the destructor. The garbage collector in Python manages memory automatically. for instance, when an object is no longer relevant, it clears the memory. In ... Read More

Advertisements