coderz.py

Keep Coding Keep Cheering!

Thread class and its Object

The Thread class in Python’s threading module is used to create and manage threads. We can extend this class to create a Thread or create a Thread class object directly and pass a member function from another class. There are two methods for creating the Thread object and specifying the activity to be carried out: […]

December 31, 2022 | python | No comments

threading Module In Python

Python threading, as we saw in the previous tutorial, allows us to run different parts of our program concurrently, which can simplify our design. Functions of threading Module: Following are some of the Functions: Function Description active_count() Return the number of active Thread objects. The count returned is the same as the length of the list […]

December 30, 2022 | python | No comments

Multithreading In Python

Let’s look at Python threads first before presenting the idea of multithreading. Threads: Threads are quick processes (smaller versions of larger processes) that can operate concurrently and in parallel with one another, with each thread capable of carrying out a specific task. Processes frequently house threads. Within a single process, several threads may exist. Threads share […]

December 29, 2022 | python | No comments

Python File Operations

Why are file operations required in Python?Working with files is a must when dealing with large datasets in machine learning problems. Because Python is a popular data science language, you should be familiar with the various file operations that Python provides. Reading a File: The readline() function reads a line from a document. The string […]

December 29, 2022 | python | No comments

File Handling in Python

What is File Handling? Every web app requires the handling of files. File handling is critical when data must be stored permanently in a file.  A file is a named location on the disc where related information is stored.  After the program has terminated, we can access the stored information (non-volatile). File Access Modes: Access Modes govern the activities you can perform on the opened file. These describe how to use the file once it has been opened. These modes also specify the location of the […]

December 25, 2022 | python | No comments

Python Exception Handling – III(Raise Keyword )

In Python, the raise keyword is primarily used for exception handling. Exception handling is responsible for handling exceptions or errors so that the system does not fail due to incorrect code. The raise keyword generates an error and halts the program’s control flow. It is used to invoke the current exception handler so that it […]

December 23, 2022 | python | No comments

Python Exception Handling – II(Finally Keyword )

Finally Keyword  Python has a finally keyword that is always executed after a try and except block. The finally block is always executed after the try block has terminated normally or due to an exception. Even if you return in the except block, the finally block will still be executed. Note: In Python, the keyword […]

December 22, 2022 | python | No comments

Python Exception Handling – I

What is Python Exception Handling? Exception handling is a Python concept used to handle exceptions and errors during program execution. Exceptions can be unexpected, or a developer may anticipate some disruption in the code flow due to an exception that may occur in a specific scenario. In either case, it must be addressed. Try and […]

December 21, 2022 | python | No comments

Errors and Built-in Exceptions

A minor typing error can result in an error in any programming language as we must follow the syntax rules when coding in any programming language. Python Errors: We can make mistakes when writing a program that causes errors when we run it. When a Python program encounters an unhandled error, it crashes. An exception […]

December 19, 2022 | python | No comments

Operator Overloading in Python

Operator overloading refers to providing meaning that extends beyond their predefined operational meaning. For example, the operator + can be used to add two integers, join two strings, or merge two lists. It is possible because the ‘+’ operator is overloaded by the int and str classes. Therefore, the different behavior of a single operator […]

December 18, 2022 | python | No comments

Advertisement