discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem extracting individual elements from pmt list and pmt diction


From: George Edwards
Subject: Re: Problem extracting individual elements from pmt list and pmt dictionary messages
Date: Fri, 29 Jul 2022 14:31:33 -0500

Hi Jeff,

Thank you very much! 

Please make references directly to my pmt objects P_list and P_dict, so I can learn how to get elements from them?

Thank you!
Regards,
George


On Fri, Jul 29, 2022 at 2:58 PM Jeff Long <willcode4@gmail.com> wrote:
k = pmt.intern('spam')
nil = pmt.get_PMT_NIL()
v = pmt.dict_ref(d, k, nil)

The last argument to dict_ref is what gets returned if the key is not found.

On Fri, Jul 29, 2022 at 11:13 AM George Edwards <gedwards.eng@gmail.com> wrote:
Hello GNURadio Community, 

I am creating a Python OOT block to send/receive pmt list and pmt dictionary messages. In both cases, I am having problems extracting the elements in the message. Let's assume (some trivial values):
P_list = pmt.to_pmt([1, 2, 3.45, 'eggs'])
P_dict = pmt.to_pmt({'spam': 20, 'eggs': 40})

How do I extract individual elements from P_list and P_dict? Nothing I tried worked.

I appreciate any help.

Regards,
George

reply via email to

[Prev in Thread] Current Thread [Next in Thread]