A recursive regular expression is a feature that allows the entire regex pattern or part of it to be re-executed on the remaining unmatched text. The syntax (?R) or (?0) defines recursive regex in Python. Don’t worry if that definition seems intimidating. It will get clear when we work on examples.
Continue readingCategory Archives: Python
Add Padding to Images in Python
Image padding is adding layers of pixels to an image to modify its shape for a given purpose, as shown in the Figure below.
Continue readingPrint Excel Workbook Using Python
Printing an Excel workbook may mean – reading and displaying the contents of an Excel file on the console or printing the XLSX file into a file. The second option may involve sending the Excel file to a printer machine for physical printing.
Continue readingHow to Make a Video Out of Images in Python
A video is a sequence of images (called frames). This article will discuss how to create a video from images using Python. We will discuss three methods of doing this:
Continue readingInstall urllib2 for Python 3
A short answer (TL;DR): urllib2 is a built-in library in Python 2 that has been replaced with the urllib package in Python 3. The urllib module comes pre-installed in Python 3; therefore, you don’t have to install it.
Continue readingGet the Size of a NumPy Array in Python
You can see this topic in two ways – determining the number of elements in a NumPy array or getting the memory size of the array. Let’s discuss this two.
Continue readingConvert XLSX to CSV in Python
XLSX is a file extension for Microsoft Excel spreadsheets, while CSV is a Comma-Separated Value file.
Continue readingCheck for Palindrome Using Python
A sequence (string/number/phrase) is said to be a palindrome if the sequence reads the same backward as forward. For example, madam, civic, refer, 14541, and level.
Continue readingAsk a Question in Python
Asking questions in Pyhton entails asking a question and accepting an answer from the user.
Continue reading__file__ is not defined in Python
The dunder __file__ is a variable that stores the path to the Python module/script being imported (executed). It is generated when the actual module or script is executed.
Continue reading