def get_variable(relpath, keyword='<STR_LIT>'):
for line in open(os.path.join(os.path.dirname(__file__), relpath), encoding='<STR_LIT>'):<EOL><INDENT>if keyword in line:<EOL><INDENT>if '<STR_LIT:">' in line:<EOL><INDENT>return line.split('<STR_LIT:">')[<NUM_LIT:1>]<EOL><DEDENT>elif "<STR_LIT:'>" in line:<EOL><INDENT>return line.split("<STR_LIT:'>")[<NUM_LIT:1>]<EOL><DEDENT><DEDENT><DEDENT>
Read __version__ or other properties from a python file without importing it 

    from gist.github.com/technonik/406623 but with added keyward kwarg