def get_property(prop, project):
    result = re.search('{}\\s*=\\s*[\\\'"]([^\\\'"]*)[\\\'"]'.format(prop),
        open(project + '/__init__.py').read())
Creating a __version__ attribute for python packages without getting into trouble