Category python-top-tutorials

Python method overriding

Python Method Overriding You can always override a superclass method. One reason to override a superclass method is that you might want to use special or different functionality in your subclass. Example class Parent: # define parent class def myMethod(self):…

Python main thread

Python Main Thread Every Python program has at least one thread of execution, called the main thread. By default, the main thread is a non-daemon thread. Sometimes, we need to create additional threads in our program to execute code concurrently.…

Python named threads

Python Naming Threads A thread’s name is used for identification purposes only and has no semantic effect. Multiple threads can have the same name. The thread name can be specified as a parameter to the thread() constructor. thread(name) Here, name…

Python Directory

Python Directories All files are contained within directories, and Python has no problem manipulating them. The os module has several methods that help you create, delete, and change directories. mkdir() Method You can use the mkdir() method of the os…

Python History

History of Python Guido Van Rossum is a Dutch programmer who created the Python programming language. In the late 1980s, he worked at the Centrum Wiskunde & Informatica (CWI), a computer science research institute in the Netherlands, developing the ABC…

Python abstractions

Python Abstraction Abstraction is a key principle of object-oriented programming. It refers to a programming approach that exposes only relevant data about an object, hiding all other details. This approach helps reduce complexity and improve application development efficiency. There are…

Python copy list

Copying Lists in Python In Python, a variable is simply a label or reference to an object in memory. Therefore, the assignment “lst1 = lst” refers to the same list object. Consider the following example: lst = [10, 20] print…