What Is Decorator In Python With Example

Decorators can add new functions or restrictions to the decorated objects without modifying the original source code. There are many kinds of decorators, including function decorators and class decorators. The name of decorator is different in many programming languages. It embodies the decoration pattern in the design pattern and emphasizes the open and closed principle.

What Is Decorator In Python With Example Read More »

How To Use User Defined Exception In Python

Python provides a lot of built-in exception classes. All the built-in classes are sub-class of builtins.BaseException class. Besides the built-in exception class, you can also create customize exception classes. But all custom exception classes must extend builtins.Exception class. The builtins.Exception class is also a sub-class of builtins.BaseException class. This example will tell you how to

How To Use User Defined Exception In Python Read More »

How To Rename IBOutlet Variable Or IBAction Function Without Lose Connection In Swift

When I develop the iOS app user interface, I add one button and one activity indicator in the main storyboard file. Because I want to write swift source code to manage the button and the activity indicator, so I press the Control key and Drag & Drop the button and the activity indicator from the

How To Rename IBOutlet Variable Or IBAction Function Without Lose Connection In Swift Read More »