Difference Between yield and return in Python

A yield statement is used to define generators in Python. The yield statement suspends execution of a function and sends a value back to the caller, while saving state and later resuming meaning the whole generator itself can still be resumed after the return value is obtained. A return statement ends the execution of the …

Difference Between yield and return in Python Read More »

Android: Your CPU does not support VT-x

Android: Your CPU does not support VT-x: If you have installed Andriod Studio and if you are trying to create  virtual device(s) on an AMD processor-based laptop, most probably the following issue would arise: Unfortunately, your computer does not support hardware accelerated virtualization. Here are some of your options: 1) Use a physical device for …

Android: Your CPU does not support VT-x Read More »

How to Install Docker in Ubuntu 18.04 Cheat-sheet

How to install Docker in Ubuntu 18.04: Docker is containerization application. Containers are platforms that let you run your applications in resource-isolated processes. Unlike virtual machines that you create in Virtual Box, containerization applications like Docker provide more portability, user-friendliness, and closeness to the host operating system and its resources. Here in this post, I …

How to Install Docker in Ubuntu 18.04 Cheat-sheet Read More »

4 Ways to Swap 2 Variables in Python

4 Ways to Swap 2 Variables in Python

Ways to Swap 2 Variables in Python: In computer programming, the act of swapping two variables refers to mutually exchanging the values of the variables. For example, if a = 5 and b = 6, then after swapping these two variables, a = 6 and b = 5. To perform this, there are many ways that one can follow. Here …

4 Ways to Swap 2 Variables in Python Read More »

What does if __name__ == “__main__”: do?

What does if __name__ == “__main__”: do? The best answer I found after searching for it in Google was in StackOverFlow. According to it, whenever the Python interpreter reads a source file, it does two things: it sets a few special variables like __name__, and then it executes all of the code found in the file. …

What does if __name__ == “__main__”: do? Read More »

Python Program to Send Emails Using Yagmail

Sending mail using yagmail

With Yagmail, sending e-mail using a Python program is easier than ever before. Yagmail – Yet Another Gmail/SMTP Client is a user-friendly API that simplifies the process of sending emails. In this post, I am going to share how to use yagmail, the API described above. If you want to read the full documentation of this …

Python Program to Send Emails Using Yagmail Read More »