Author name: admin

The Tkinter Spinbox Widget

When to use the Spinbox Widget The Spinbox widget can be used instead of an ordinary Entry, in cases where the user only has a limited number of ordered values to choose from. Note that the spinbox widget is only available in Python 2.3 and later when linked against Tk 8.4 or later. Also, note that several …

The Tkinter Spinbox Widget Read More »

Stupid Python Tricks: The KeyboardInterrupt Exception

If you try to stop a CPython program using Control-C, the interpreter throws a KeyboardInterrupt exception. Unfortunately, this is an ordinary exception, and is, like all other exceptions, caught by a “catch-all” try-except statement. For example, if your program contains code like the following, your users may find that pressing Control-C is a great way to mess up their …

Stupid Python Tricks: The KeyboardInterrupt Exception Read More »

The Consumer Interface in Python

The consumer interface is a simple “data sink” interface, used by standard Python modules such as xmllib and sgmllib. Other examples include the GZIP consumer and PIL’s ImageParser class. The consumer will typically convert incoming raw data in some way, and pass it on to a another layer. For example, XML parsers implementing this protocol usually parse the data stream into a stream of …

The Consumer Interface in Python Read More »


Application Programming Interface (API) in simple terms

In this post, we will see what an Application Programming Interface is in simple terms with examples and elaborate on its use in various systems. What is an Application Programming Interface or API? Application Programming Interface (API) can be considered as a bridge between two different software systems, allowing them to communicate with each other …

Application Programming Interface (API) in simple terms Read More »

Indentation in Python | Why does Python use indentation

What is Indentation? Indentation is nothing but the space at the beginning of a code line. In other programming languages, like C++, Javascript, etc., the Indentation is just for the readability of code while in Python, Identation is mandatory otherwise the code will throw IdentationError. In Python, Indentation is used in various cases like while …

Indentation in Python | Why does Python use indentation Read More »