简体   繁体   中英

GNU Radio (Companion) gives Python Syntax Error on variable substitution

I'm trying out GNU Radio (Compantion) for the first time right now, having bought an RTL SDR (the SDR SMARt from NooElec) and trying to build a simple FM radio. I have a (reasonably correct) flowgraph and Compilation runs without errors, but when I try to run it, I get the following Error:

Generating: '/home/fl0wless/.grc_gnuradio/Radio.py'

Executing: /usr/bin/python3 -u /home/fl0wless/.grc_gnuradio/Radio.py

  File "/home/fl0wless/.grc_gnuradio/Radio.py", line 42
    self.samp_rate = samp_rate = 2M
                                  ^
SyntaxError: invalid syntax

Instead of substituting the value of samp_rate , it seems the whole expression is simply inserted. This also happens with all other variables, if I remove the current one another appears.

Is this a (known) bug? The GNU Radio installation is fresh, as is the python3 one, I haven't tampered with anything (yet).

Forget it, sorry, I found the problem: while Gnu Radio Companion will show you variables truncated with units (k, M, etc.) one cannot, in fact, enter them inside variable fields as they are not translated into their original python friendly numeric values. So my mistake was literally entering 2M into the field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM