# Posting messages from outside the work function in Python

**URL:** <https://www.ruby-forum.com/t/posting-messages-from-outside-the-work-function-in-python/231016>\
**Category:** GNU Radio\
**Created:** [July 17, 2014, 3:00pm UTC](https://www.ruby-forum.com/t/posting-messages-from-outside-the-work-function-in-python/231016 "2014-07-17T15:00:41Z")\
**Posts on this page:** 2\
**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:** [July 17, 2014, 3:00pm UTC](https://www.ruby-forum.com/t/posting-messages-from-outside-the-work-function-in-python/231016/1 "2014-07-17T15:00:41Z")

</div>

Hello,

I would like to write a block in Python that is a message source (no IO  
ports, only message port). I’ve found a few examples in C++ of blocks  
that  
don’t do signal processing and don’t rely on the work() function, but  
what  
would be the equivalent in python? If it is possible, how would I handle  
posting messages without relying on the work() function?

BR,  
Michal

---

<div class="post-metadata">

**Author:** ![Michal\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/77aa72/32.png) [@Michal\_J](https://www.ruby-forum.com/u/Michal_J)\
**Post date:** [July 17, 2014, 3:22pm UTC](https://www.ruby-forum.com/t/posting-messages-from-outside-the-work-function-in-python/231016/2 "2014-07-17T15:22:51Z")

</div>

On Thu, Jul 17, 2014 at 8:59 AM, Michal J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

Here are some examples:

[https://github.com/jmalsbury/gr-mac/blob/master/python/packet\_framer.py](https://github.com/jmalsbury/gr-mac/blob/master/python/packet_framer.py)

Tom
