Python Yield Keyword

Python Yield Keyword

The yield keyword in Python is typically associated with the use of Generators. In this tutorial, let’s take a look at the yield keyword in Python and Generators as well. Generators are used in Python to complete tasks associated with processing large amounts of data and doing so in a memory-efficient way. The yield keyword inside of a for loop provides a nice elegant syntax for using generators in Python.…

Python Datetime Module Tutorial

Python Datetime Module Tutorial

Working with various dates and times in computer applications is a universal requirement. When writing programs in Python, software developers can lean on the Python Datetime Module for help in calculating these sometimes complex concepts. The Datetime module in Python is extensive and offers functions for efficient time formatting and manipulation, as well as date and time math calculations. In this Python Datetime Module Tutorial, we’ll take a look at some of the commonly used functions in the datetime module and how to make use of them.…

Python os Module Tutorial

Python os Module Tutorial

Python has a dedicated module for working with and interacting with the operating system of the machine Python is installed on. This is the Python os module. It is a wonderful tool with many helpful functions making it possible to directly manipulate the file system. The os module works well on any operating system you like whether that be Windows, Linux, or Mac. The Python os module is very extensive and in this Python os Module Tutorial, we’ll take a look at some of the most useful and common techniques you can use.…

How To Create Flask Base Template

How To Create Flask Base Template

In Flask just like in most web development frameworks, you can make use of base templates and the extending of templates to reduce repetitive markup. In other words, you can have a base HTML file and have components from that shown on every single webpage. We can refactor some of the markups we have created already in our Flask application in order to make use of templates that extend from other templates and use various blocks to get the layout we want.…

How To Use Flash Messages In Python Flask

How To Use Flash Messages In Python Flask

Flash messages are used in web applications to provide helpful feedback to users as they navigate a graphical user interface. You are likely familiar with flash messages if you have ever signed up for an account with any of the popular services available on the Internet today. These messages typically appear one time for a given event and disappear after a short period of time with the help of some simple JavaScript code.…

How To Redirect To Url In Python Flask

How To Redirect To Url In Python Flask

The redirect() function allows us to redirect a user to the URL of our choice. In the Flask application that we are building so far, we have a /shortenurl route that checks to see what method type is in use. If it is a GET request, we are simply returning some text to the user. Instead of that, we can redirect them to the homepage so they can enter a URL and shortcode.…

How To Use Forms In Python Flask

How To Use Forms In Python Flask

Allowing a user to submit data to your web application is a universal need. No matter what web framework or solution you are using, HTML Forms are the method typically used to gather and submit data from an end-user to a web application. In this tutorial, we’ll take a look at how to get forms to work in Flask, how to get form data in Flask, and how to access various form fields when using Flask.…