Popular Python cookbook recipes – small Python programs, with example code samples to get you started on the language, and give you in-depth knowledge.
When you take photographs and post it onto the internet, it is often handy adding a watermark to prevent and discourage unauthorized copies or image theft. Below is a simple Python script that uses the PIL module to watermark your images. It adds a visible text watermark to the image using the system font.
from PIL import Image, ImageDraw, ImageFont, ImageEnhance
import os, sys
FONT = 'Arial.ttf'
So. What’s better than making a list of video files on your hard disc drive? Let’s make a list of all video files in a folder, and all other folders in it! What is a Recursive Function in Python? Recursion is a concept in computer science. Essentially, it divides a problem into sub-problems. Recursion in Python […]Read More
Python offers a lot of powerful and easy to use tools for scraping websites. One of Python’s useful modules to scrape websites is known as Beautiful Soup. In this example we’ll provide you with a Beautiful Soup example, known as a ‘web scraper’. This will get data from a Yahoo Finance page about stock options. […]Read More
Python is a very powerful scripting language and you will be pleasantly surprised to find that a lot of the common functions you would want to build are available to you in library form. The Python ecosystem is very alive and full of libraries. Point in case, today I will show you how to easily […]Read More