discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] FW: new block with python


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] FW: new block with python
Date: Thu, 28 Jan 2016 17:29:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

Hi Yan,

pn = []

is an empty list.

pn[i] += d

tries to access an element of that list.

I'm not quite sure you should be creating a pn = [] in every for loop iteration, neither.
This looks like a Python programming issue to me. It's probably a good idea to practice a little bit on your python skills; python.org actually has good Python2 tutorials!

Best regards,
Marcus

On 01/28/2016 05:22 PM, Yan Huang wrote:

 

 

 

Hi all,

I'm building a new block by python to do sequential energy detector. In my python block file, I want to divide my input into different part with same length(number). And add the samples in each part.The python file is attached.

But when I use my block, it always print as follows:

 pn[i] += d
IndexError: list index out of range


Evey suggestion will be appreciated. Thanks in advance.

Yan


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

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