python implementation of str_readfile. This is interesting since this function returns a struct which is transparently turned into a python object