Check Which Packages Installed Inside a Python Virtual Env

When working with Python virtual environment, there is a need to run a stocktake of what is installed inside the environment. Pip Freeze The following pip command will show which packages are installed inside a Python virtual environment. Before running the command, go ahead and activate the virtual environment using the following command (the environment…… Continue reading Check Which Packages Installed Inside a Python Virtual Env

Published
Categorized as Python 3

Install Flask on Ubuntu and Python Virtual Env

In this post, we will install the Flask web framework on Ubuntu Linux 20.04 inside a Python virtual environment. If you don’t have a Python virtual environment, let’s create one. First, we need to install Python virtual environment tools using the following command. sudo apt-get install python3-venv Now that we have the virtual environment installed…… Continue reading Install Flask on Ubuntu and Python Virtual Env

Published
Categorized as Flask

Create a List With Python

This post will show how to create a list object with Python and print it out as a whole or using a for loop statement. Lists A list in Python allows us to store multiple items and later on retrieve them for processing. Lists are structured and hold the information in order. Create and print…… Continue reading Create a List With Python

Published
Categorized as Python 3

Create a Function With Python 3

Writing code is all about efficiency and adoption of DRY (don’t repeat yourself), and functions are essential components to these concepts. With Python, we can create functions that take variables and functions that doesn’t take variables, as you will see shortly. In the following code example, we will create two functions. The first takes two…… Continue reading Create a Function With Python 3

Published
Categorized as Python 3

Get File Size With Python

In this post, we will learn how to get a file size with Python using a build-in function. Using Python build-in function, we can measure a file size using Python len function. Code In the below code example, I’m opening and reading a file and using the len function to measure the size of the…… Continue reading Get File Size With Python

Published
Categorized as Python 3

How to Read Files With Python

This blog post will show how to read files with Python built-in functions. Files Working with files and content is something that Python knows how to handle very easily and allow developers to be very creative. Options In the following examples, I have a code the I am passing a file as an argument (example…… Continue reading How to Read Files With Python

Published
Categorized as Python 3