output = Popen(["dcop","yakuake","yakuake-mainwindow#1","hidden()"], stdout=PIPE).communicate()[0] print type(output) if output == "false":