def get_q_version(q_home):
    """Return version of q installed at q_home"""
    with open(os.path.join(q_home, 'q.k')) as f:
        for line in f:
            if line.startswith('k:'):
                return line[2:5]
    return '2.2'
def get_q_version ( q_home ) : with open ( os . path . join ( q_home , 'q.k' ) ) as f : for line in f : if line . startswith ( 'k:' ) : return line [ 2 : 5 ] return '2.2'
Return version of q installed at q_home