Consider the following Python function:
1 2 3 4 5 |
def func1(val1, val2, val3): return val1 * val2 + val3 # Calling the function. result = func1(3, 4, 6) |
Consider the following Python function:
1 2 3 4 5 |
def func1(val1, val2, val3): return val1 * val2 + val3 # Calling the function. result = func1(3, 4, 6) |
Adding random delays between queries is a great way to avoid getting blocked while running scripts in Python. This technique can be used to ensure that the script is not making too many requests in a short period and thus, preventing it from being blocked by the server.
Continue readingPython interpreter uses the following three file objects on the sys library for standard input, output, and errors (exceptions):
Continue readingEvery time a Python object is stored in memory, it is assigned an integer value that references its address. The address is used to distinguish between different objects present in memory.
Continue readingThis article discusses how to read data from serial ports using serial.read() and serial.readline() functions on the pyserial library. Before we do that, however, let us cover some prerequisites.
Continue readingMulti-line strings can come in two forms in Excel files (shown by B and C in the Figure below). In B, the sentence is broken word by word so that each word appears in its line, whereas, in C, text wrapping is implemented.
Continue readingA 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 readingImage padding is adding layers of pixels to an image to modify its shape for a given purpose, as shown in the Figure below.
Continue readingPrinting 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 readingA 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 reading