# Gr.hier\_block2 in Python

**URL:** <https://www.ruby-forum.com/t/gr-hier-block2-in-python/219026>\
**Category:** GNU Radio\
**Created:** [April 19, 2012, 3:02am UTC](https://www.ruby-forum.com/t/gr-hier-block2-in-python/219026 "2012-04-19T03:02:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 19, 2012, 3:02am UTC](https://www.ruby-forum.com/t/gr-hier-block2-in-python/219026/1 "2012-04-19T03:02:46Z")

</div>

So, I’ve been thinking about my ideas with respect to a “universal”  
source block that would allow runtime selection of FCD, UHD, or RTL-SDR  
blocks.

Is it possible to specify a source block purely in Python using  
gr.hier\_block2?

If so, then the Python code could construct and plug in the appropriate  
actual source block “under the covers”, based on some  
yet-to-be-determined syntax at runtime. It could even use the  
conditional-importing goo in Python to decide whether you have  
any/all of the appropriate hardware-specific support configured in  
the build.

–  
Marcus L.  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org/)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.

---

<div class="post-metadata">

**Author:** ![Marcus\_DSLeech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/74df32/32.png) [@Marcus\_DSLeech](https://www.ruby-forum.com/u/Marcus_DSLeech)\
**Post date:** [April 19, 2012, 3:24am UTC](https://www.ruby-forum.com/t/gr-hier-block2-in-python/219026/2 "2012-04-19T03:24:28Z")

</div>

On Wed, Apr 18, 2012 at 18:01, Marcus D. Leech [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Is it possible to specify a source block purely in Python using  
> gr.hier\_block2?

Yes. Just specify the input signature with gr.io\_signature(0,0,0),  
and the output with whatever you need, probably gr.io\_signature(1,1,  
gr.sizeof\_gr\_complex) .

Internally just connect the output of whatever block you instantiate  
to the output of the hier\_block2 the usual way.

Johnathan
