Wednesday, April 24, 2013

Making python scripts from GRC

A very interesting fact of gnuradio-companion is that it enables you to make executable python scripts automatically.

There is an icon on the top pane in the gnuradio-companion window something like this

When you hover your cursor there it will show "Generate the flow graph"

So after finishing the connection of respective blocks when you click on this icon, it will automatically generate an executable python file in your current directory. Name of this file by default will be

You can change the name of this file by editing in the "Options" blokc of your gnuradio-companion window whic is located on the top left of the gnuradio-companion window.

Just change the name from top_block to whatever you want and the next time it will make an executable python file with that name.

Now you can run that python file directly from the terminal by typing ./name_of_file

Also you can edit the file for extra options and customizations which you cannot do in gnuradio-companion.

No comments:

Post a Comment