Ok, I have found button :), but the problem is now following. Part of my script looks like this:
def aaa(a):
global state
state = 1
state = 1
data = "">
if __name__ == '__main__':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
(options, args) = parser.parse_args()
tb = top_block()
while(True):
if state == 1:
print "aa"
state = 0
data.append(0)
tb.blocks_vector_source_x_0.set_data(data)
tb.run()
print tb.blocks_vector_sink_x_0.data()
aaa is callback function called when the button is pressed.