If you are getting Python PIL, pil.unidentifiedimageerror: cannot identify image error, then follow below steps to resolve it. Steps: Check whether the image you are using is supported by PIL or not If you are processing images from a folder, go to the folder, unhide the files, check whether there are any image files not […]
Simple python code to download Instagram Images. Below code uses Instalooter python library.
To implement “Press Any Key To Continue” in a batch file, add below commands in your batch file. It simply pauses the batch file execution until the user presses any keyboard button. Note: You can change the “Press Any Key To Continue” as per your requirement. It is just a message. pause > nul command […]
Simple batch file commands to count number of files in a folder or directory and then store it in a variable Step 1: To Count the number of files in a folder including sub-folders. Above command counts the number of files in a folder (mentioned as “Folder Path”) and writes the count number to a […]
Below Python code resizes an image keeping it’s aspect ratio using PIL library Image Module. The above code is tested on Windows 10 PC using PyCharm 2019.3.3 In the code, we have set the height of the image to 900 Percentage of height of the resized image calculation proportional width value calculation using below formula […]
Python Pillow Pillow is a Python Imaging Library (called as PIL), which supports opening, manipulating (filtering, enhancing, masking, watermarking, resizing etc) and saving of images. The latest version can identify and read more than 30 image formats. Write support is intentionally restricted to few image formats. Installing Python Pillow on Windows To install Python Pillow […]
1. Python Crash Course: A Hands-on, Project based Introduction To Programming This book is highly recommended by many verified purchasers on Amazon. They mentioned that it is a great book for beginners to learn Python. Below are some of their comments “Effective For Teaching The Basics” “From your first exception error to your first Hello […]
Python code to get last four characters of a string. This single line code, excluding string line, prints the last 4 characters of the string. Change the number to get more or less characters. Example string: GetHowStuff Expected Output (last 4 characters): tuff string=”GetHowStuff” #prints last 4 characters of the string print(string[-4:])
Extract text between two square brackets in python. Example string: Get[How]Stuff Expected Output: How Below is the python script
Below is the code to reverse a string in python using for loop. Output Alse see Calculate Python elapsed time in milliseconds