Get a Python Package Version
Part of maintaining a Django-based application like MDN's kuma is ensuring Python packages are up to date. I was recently testing an upgrade on a remote system and needed to ensure that a given Python package was at the version number it should be. Here's how I retrieved the package version:
import nose # Nose is a test utility. Replace with your desired package here.
# Output: 0.3.1
__version__ property returns the exact version number for a Python package. Some Python packages use a
VERSION property as well, but
__version__ should be the most reliable.
It's no secret that Facebook has become a major traffic driver for all types of websites. Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate websites directly. And of course there are Facebook "Like" and "Recommend" widgets on every website. One...
CSS filters aren't yet widely supported but they are indeed impressive and a modern need for web imagery. CSS filters allow you to modify the display of images in a variety of ways, one of those ways being displaying images as grayscale.
Doing so requires the...
One of the most popular code snippets of posted on my blog has been the scrolling "Go To Top" link snippet. The premise of the snippet is simple: once the user scrolls an element (usually the BODY element) past a given threshold, a "Go...