# Edit GNU Radio Companion generated Python script location

**URL:** <https://www.ruby-forum.com/t/edit-gnu-radio-companion-generated-python-script-location/233615>\
**Category:** GNU Radio\
**Created:** [December 29, 2014, 2:23pm UTC](https://www.ruby-forum.com/t/edit-gnu-radio-companion-generated-python-script-location/233615 "2014-12-29T14:23:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [December 29, 2014, 2:23pm UTC](https://www.ruby-forum.com/t/edit-gnu-radio-companion-generated-python-script-location/233615/1 "2014-12-29T14:23:17Z")

</div>

Hi,

I have a couple of blocks and a flow graph that uses them. When I  
generate  
the flow graph of a block using GNU Radio Companion, the Python script  
is  
generated at ~/.grc\_gnuradio/block1.py  
The same thing happens with the flow graph but, in addition, the call to  
my  
blocks inside the generated Python script looks like this:

execfile("/home/myuser/.grc\_gnuradio/block1.py")

Which means that when I copy these scripts to the target machine I need  
to  
edit that line to match the location of the block1.py in the target  
machine.

How can I edit the location where GNU Radio Companion puts the scripts?  
The  
Edit \> Properties menu is disabled ☹

Thanks,  
Murray

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [December 30, 2014, 6:17pm UTC](https://www.ruby-forum.com/t/edit-gnu-radio-companion-generated-python-script-location/233615/2 "2014-12-30T18:17:15Z")

</div>

On Mon, Dec 29, 2014 at 8:21 AM, Murray T.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Which means that when I copy these scripts to the target machine I need to  
> edit that line to match the location of the block1.py in the target machine.
> 
> How can I edit the location where GNU Radio Companion puts the scripts?  
> The Edit \> Properties menu is disabled ☹
> 
> Thanks,  
> Murray

The Properties menu item is there more for future use but doesn’t yet do  
anything. In our current work to overhaul GRC to make it more  
user-friendly, I hope these are things we can more easily set and  
change.

In the meantime, you can control the location of the output of the  
hier\_blocks by setting the environmental variable GRC\_HIER\_PATH. This  
will  
allow you to build and install the .py and .py.xml files into whatever  
path  
you want, and that execfile sring will similarly point there. One way to  
handle this is:

$ export GRC\_HIER\_PATH=/newpath  
$ grcc hier\_block\_file.grc

Hope this helps.

Tom

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [February 12, 2015, 9:21am UTC](https://www.ruby-forum.com/t/edit-gnu-radio-companion-generated-python-script-location/233615/3 "2015-02-12T09:21:52Z")

</div>

Thanks for your answer Tom and sorry for the delay replying to you.

I tried setting the environment variable GRC\_HIER\_PATH but it didn’t  
make  
any difference. I also tried setting  
GRC\_PREFS\_PATH  
GRC\_BLOCKS\_PATH  
HIER\_BLOCKS\_LIB\_DIR

But my grc companion 3.7.6.1 keeps compiling the blocks to  
~/.grc\_gnuradio  
Can you think of anything else I could try?  
I’ve tried with Ubuntu 12.04 and Ubuntu 14.04.

Thanks,  
Murray

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [February 12, 2015, 12:00pm UTC](https://www.ruby-forum.com/t/edit-gnu-radio-companion-generated-python-script-location/233615/4 "2015-02-12T12:00:42Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA256

On 02/12/2015 09:19 AM, Murray T. wrote:

> But my grc companion 3.7.6.1 keeps compiling the blocks to \> ~/.grc\_gnuradio Can  
> you think of  
> anything else I could try? I’ve \> tried with Ubuntu 12.04 and Ubuntu  
> 14.04.

I created an issue [1] for this. I came up with two different solutions.  
Feadback welcome.

Sebastian

[1] [http://gnuradio.org/redmine/issues/763](http://gnuradio.org/redmine/issues/763)

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1

iQIcBAEBCAAGBQJU3Id7AAoJEIcqoDnyZkMDRT8QAJ9DLAQ+yRoVBZfWALu/W6td  
yNqVz3qrPLOb+FlhQpNqwEXM82IcGKxwwQW3MAODvsaj7y/SD7JxSXouwIGNGFLx  
Uld69XmAd0N0fkP3TbSIyxC9/6AgrXNmrs5GDjTomaYwvSOQlguz308+6SawzWrP  
XYVIMb8c0565Aa3YNV/457dk7/dc2C15/Bgg98LSF7f5NHRrKh03Ek0kQ6yICylc  
jVpl0ysZVBc6Aoo4p+OO8elivf9FHj/+IJprqmBzXskH3TDdQtH8fSa0CUTG0XOD  
e3WhHJrD4dtwZ/kOMulUrjKeq2+zCoP01WIm/U76t1I4qXTTXRtRkmkj90ohWe/g  
9+faxYwolLra9YY0T11CzZE5FG4cGusBEUzZT3l6nKhLgowhLv0zsN5wg+IWv5Ie  
8X9TueYmzCPR0UrYNLmFtqPDzMN93AlYSiBM4eiJIiVm5ouuWXFhVAZV+Is9SpWL  
c3MGXJlCkxMeLM3pN12MHEuI72XqqBX6x51d8WJCsDDtdGB5fV+Bl5P/tts+fYG2  
hsxxcKsHXrpPQ2Vzq13AHErQcZs0RzhcJj3+6xxQglM+55ldDAEAzfQUTg4x6KZY  
vYBUz/il0g1YSUfcyqGPLwIXED9t/7IeJkLvFbS1eub8a/jotx19i3ipUiMM9HQi  
O5VAE8ahOBBxaW391qdH  
=0ojz  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![Murray\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3bc359/32.png) [@Murray\_T](https://www.ruby-forum.com/u/Murray_T)\
**Post date:** [February 12, 2015, 2:40pm UTC](https://www.ruby-forum.com/t/edit-gnu-radio-companion-generated-python-script-location/233615/5 "2015-02-12T14:40:13Z")

</div>

On Thu, Feb 12, 2015 at 5:59 AM, Koslowski, Sebastian (CEL) \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> Feadback welcome.
> 
> Sebastian
> 
> [1] [http://gnuradio.org/redmine/issues/763](http://gnuradio.org/redmine/issues/763)

Excellent, Sebastian, thanks for kicking that off. This is definitely an  
issue that needs to be solved.

Tom
