Problem using Parser


I am trying to write a code for qpsk receiver and want to get some
parameters from the user by using parser. However I get some error
when I execute the code

#!/usr/bin/env python

from gnuradio import gr, gru, eng_notation, optfir, modulation_utils
from gnuradio import usrp
from gnuradio import blks2
from gnuradio.eng_option import eng_option
from optparse import OptionParser
from usrpm import usrp_dbid
import math
import sys
import wx

#import psk
import cmath
from pprint import pprint

class qpsk_rx_block(gr.hier_block2):

def init(self,argv):

gr.hier_block2.__init__(self, "qpsk_rx_block",
            gr.io_signature(1, 1, gr.sizeof_char),       # Input 

gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output

            parser.add_option("-R", "--rx-subdev-spec",

type=“subdev”, default=None,
help=“select USRP Rx side A or B (default=A)”)
parser.add_option("-f", “–freq”, type=“eng_float”,
help=“set frequency to FREQ”, metavar=“FREQ”)

            (options, args) = parser.parse_args()

I get the error

[email protected]:/usr/share/gnuradio/examples/digital$
Traceback (most recent call last):
File “./”, line 39, in
class qpsk_rx_block(gr.hier_block2):
File “./”, line 48, in qpsk_rx_block
parser.add_option("-R", “–rx-subdev-spec”, type=“subdev”,
NameError: name ‘parser’ is not defined

Does anybody have any idea?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs