python resource

Writing a Python Package I want to open a static file i.e. something I distribute in the package

the file cty.dat is in Package called ctry.

import pkg_resources
dx_file = pkg_resources.resource_filename(__name__, "cty.dat")
txt = open(dx_file).read() #etc...