Python decorators
I came across an interesting recent addition to the Python language (as of Python 2.4). They are called decorators. Decorators are Python objects that can register, annotate, and/or wrap a Python fun...
Thoughts on technology, infrastructure, and AI
Viewing posts tagged python Clear filter
I came across an interesting recent addition to the Python language (as of Python 2.4). They are called decorators. Decorators are Python objects that can register, annotate, and/or wrap a Python fun...
In a nutshell, dowload EasyInstall from: http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install This now allows you to install python packages (called eggs). Like CPAN for PERL, i...
File magic is used on Linux and Unix systems as a binary "fingerprint" to tell what type a file actually is - this provides a much better result than MIME or filename extensions. The "magic" pattern i...
Python provides a pretty handy module for performin MD5 sums of both text and data buffers. The following function provides an MD5 sum given a file name: def get_hash(self, filename): """ Generates an...
Some handy usage information on how to use Gnu Privacy Guard (GPG) - an open source implementation of PGP: gpg --gen-key gpg --output revoke.asc --gen-revoke toms_key gpg --list-keys gpg --output publ...