Python version of file-entropy.