Hello,
I tried to print what data gr_vector_sink_f contains in the following
code:
#!/usr/bin/env python
import howto
from gnuradio import gr, gru
from gnuradio.gr import firdes
from optparse import OptionParser
from gnuradio import blks2
class howto_square (gr.top_block):
def init(self):
gr.top_block.init(self)
src_data = (-3, 4, -5.5, 2, 3)
expected_result = (9, 16, 30.25, 4, 9)
src = gr.vector_source_f (src_data)
sqr = howto.square_ff ()
dst = gr.vector_sink_f ()
self.connect (src, sqr)
self.connect (sqr, dst)
self.result_data = dst.data()
def print_data(self):
print self.result_data
if name == ‘main’:
#parser = OptionParser(option_class=eng_option, usage=“%prog:
[options]”)
#(options, args) = parser.parse_args()
hw = howto_square()
hw.run()
hw.print_data()
But it is always empty.
Any thoughts?
Thanks
View this message in context:
http://old.nabble.com/Printing-gr_vector_sink_f-data-tp29782854p29782854.html
Sent from the GnuRadio mailing list archive at Nabble.com.