In this post we will be creating a Python script that will extract all files within an existing zip file using the shutil module. The module provides a high-level interface for performing file and directory operations, such as copying, moving, and deleting files. It also supports archiving and compression, and can be especially useful forContinue reading “Python shutil – Extract files from zip file”
Category Archives: Uncategorized
Python Itertools – Incremental number Iterator
In this post we will be creating a Python script that will create an iterator consisting of incremental numbers, to do this we will be using the Itertools module implements a number of iterator building blocks inspired by constructs from APL, Haskell, and SML. See the sample of Python code that creates an incremental number iterator andContinue reading “Python Itertools – Incremental number Iterator”
Python rich – Create a progress bar
In this post we will be creating a Python script that will display a progress bar whilst running. To do this we will be using the ‘rich’ library which allows us to aesthetically pleasing command line applications. The library is very useful whereby it allows formatting to many elements of output. To install the richContinue reading “Python rich – Create a progress bar”
Python random – Random password generator
In this post we will be creating a Python script that will generate for us a random password, to this we will be using the random module. The script will take input in the form of an integer which will define the length of the password. We then have a variable named ‘store’ which containsContinue reading “Python random – Random password generator”
Microsoft Excel – Adding colour scales
In this tutorial we will be adding colour scales to the cells within our Excel spreadsheet, this function will apply a gradient fill to our cells and help give us a better idea of where each cell sits within range of others. To add colour scales to your Excel spreadsheet carry out the following steps.Continue reading “Microsoft Excel – Adding colour scales”
Python – Reading text files
In this post we will creating a Python script that will read from a text file, to do this we will be using a with statement which will run through and print the lines of text within a file. The with statement is especially useful as it will automatically close the file once done. SeeContinue reading “Python – Reading text files”
Microsoft Excel – Draw line sparklines in cell
In this tutorial we will be drawing line sparklines within an Excel spreadsheet, these are especially useful in showing trends in data. Sparklines are small charts that appear within a cell and are typically drawn without axes or coordinates. To add sparklines to you Excel spreadsheet carry out the following steps. You will then be returnedContinue reading “Microsoft Excel – Draw line sparklines in cell”
Python Matplotlib – X&Y plot types
In this post we will be generating different types of X&Y plot types in Python, to do this we will be making use of the Matplotlib library. For the purpose of this post we will be plotting the same X&Y data each time, our X and Y data arrays can be seen below consisting ofContinue reading “Python Matplotlib – X&Y plot types”
Python Int – Generating a random number
Here we will be creating a script in Python that will generate a random number within a given range. To do this we will be using the random module which enables us to a random number generator. We begin by importing the module and make use of the ‘randint’ function which will return a randomContinue reading “Python Int – Generating a random number”
Python datetime – Birthday countdown
In todays post we will be creating a script that will countdown the number of days till the users birthday. To do this we will be using the ‘datetime’ module which supplies classes for manipulating dates and times. We start by taking the users birthday as input and then pass this to our ‘get_days’ function.Continue reading “Python datetime – Birthday countdown”