Minimal grc python block

Evening all. I only recently (yesterday) started working with gnuradio
and am
having some trouble getting a minimal grc python block going. I’ve found
number of references in this mailing list and elsewhere (and lots of
links) but just can’t seem to piece it all together. Some guidance would
greatly appreciated.

My current goal is just to create a block in grc, it doesn’t even have
to do
anything yet. Here’s what I’ve done so far. I’ve added these to .bashrc:

export PYTHONPATH=$PYTHONPATH:/home/user/mygnuradioblocks
export GRC_BLOCKS_PATH=$GRC_BLOCKS_PATH:/home/user/mygnuradioblocks

As suggested by (I’ve tried the other two methods for specifying the
path as well):

And added the following two files to this folder (based on

#!/usr/bin/env python

from gnuradio import gr
import block_gateway

class my_first_block(gr.block):
def init(self):
gr.block.init(self, name = “my first block”, in_sig=None,

def work(self, input_items, output_items):
return 0


<?xml version="1.0"?> MY: FIRST BLOCK MY my_first_block import mytestblock as mtb mtb.my_first_block()
    <name>my param1</name>


MY TEST BLOCK: Bleh, hope this works!

I however can’t get grc to recognize this block, In addition I’ve tried
moving these two files to the system xml and py directories


And even modifying files in those two folders to a minimal form. In
I’m having a fairly hard time to get my first python grc block going, if
anyone could point me in the right direction for creating a minimal grc
python block it would be much appreciated.

View this message in context:
Sent from the GnuRadio mailing list archive at

FYI I just solved the problem. The and tag order was
reversed. I didn’t know that the xml format was so strict. Well on my

The blank lines in my xml data should have contained the tags, they
lost in copying the xml over for some reason.

View this message in context:
Sent from the GnuRadio mailing list archive at