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

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

Pass Arguments To a Python Script

In many use cases, your might need to develop or build a Python script that accepts arguments as values without prompting from them. Arguments For the above reason, Python allows us to write scripts and programs that accept values from the command-line either when a user runs the script or another application. Code In the…… Continue reading Pass Arguments To a Python Script

Published
Categorized as Python 3