# Re: Suppressing UHD prints

**URL:** <https://www.ruby-forum.com/t/re-suppressing-uhd-prints/242606>\
**Category:** GNU Radio\
**Created:** [July 6, 2015, 7:26pm UTC](https://www.ruby-forum.com/t/re-suppressing-uhd-prints/242606 "2015-07-06T19:26:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [July 6, 2015, 7:26pm UTC](https://www.ruby-forum.com/t/re-suppressing-uhd-prints/242606/1 "2015-07-06T19:26:28Z")

</div>

@Sebastion “Even if ’ uhd::msg::register\_handler’ would be exposed to  
python, you  
still can’t drop-in your own null-handler. Swig doesn’t support  
callbacks in the target language (python).”

This seems precisely what I have observed working with my example from  
my question on 7/2/2015 “message passing: strobe or \_post?” I use a  
Python method as a callback given to .set\_msg\_handler. This is  
certainly called when I use the message strobe to input a message to the  
block, but not when using \_post. Is this some new feature? Or am I  
wrong that the operation is the same?

Jared.

---

<div class="post-metadata">

**Author:** ![jared](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@jared](https://www.ruby-forum.com/u/jared)\
**Post date:** [July 6, 2015, 8:41pm UTC](https://www.ruby-forum.com/t/re-suppressing-uhd-prints/242606/2 "2015-07-06T20:41:50Z")

</div>

On 07/06/2015 07:25 PM, Jared D. wrote:

> @Sebastion “Even if ’ uhd::msg::register\_handler’ would be exposed to python,  
> you  
> still can’t drop-in your own null-handler. Swig doesn’t support  
> callbacks in the target language (python).”
> 
> This seems precisely what I have observed working with my example from my  
> question on 7/2/2015 “message passing: strobe or \_post?” I use a Python method as  
> a callback given to .set\_msg\_handler. This is certainly called when I use  
> the message strobe to input a message to the block, but not when using \_post. Is  
> this some new feature? Or am I wrong that the operation is the same?

Well SWIG not supporting it (see [1]) doesn’t mean one can’t write  
custom code to run Python from the C end. Python blocks are implemented  
via a gateway [2] to do this.

Sebastian

[1] [SWIG-3.0 Documentation](http://www.swig.org/Doc3.0/SWIGDocumentation.html#SWIG_nn30)  
[2]  
[gnuradio/gnuradio-runtime/lib/block\_gateway\_impl.cc at master · gnuradio/gnuradio · GitHub](https://github.com/gnuradio/gnuradio/blob/master/gnuradio-runtime/lib/block_gateway_impl.cc)

–  
Karlsruhe Institute of Technology (KIT)  
Communications Engineering Lab (CEL)

Dipl.-Ing. Sebastian Koslowski  
Research Associate

Kaiserstrae 12  
Building 05.01  
76131 Karlsruhe, Germany

Phone: +49 721 608-46275  
Fax: +49 721 608-46071  
Email: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Web: [http://www.cel.kit.edu/](http://www.cel.kit.edu/)

KIT University of the State of Baden-Wuerttemberg and National Research  
Center of the Helmholtz Association
