returns the window title of the active window

def get_active_title():
    '''returns the window title of the active window'''
    if os.name == 'posix':
        cmd = ['xdotool','getactivewindow','getwindowname']
        proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        title = proc.communicate()[0].decode('utf-8')
    else:
        raise NotImplementedError
    return title