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
15 posts found
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...
Dan at work put me on to some new Linux Kernel functionality in the form of inotify - the userland tools and libraries allow you to hook into this pretty handy capability. It essentially allows you to...