<font color="#000000"><br></font><br><div class="gmail_quote">On Thu, Sep 1, 2011 at 5:12 PM, Fulvio <span dir="ltr"><<a href="mailto:false@pp.jaring.my">false@pp.jaring.my</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<br>
I'm on python3.2, trying some experiment with OptionParser but no success<br>
<br>
>>> from optparse import OptionParser as parser<br>
>>> parser.add_option('-n','--new', dest='new')<br></blockquote><div><br>Here you've imported parser as an alias to the OptionParser class.  You can only use add_option() on an instance of that class.  Try this:<br>
<br>from optparse import OptionParser<br><br>parser = OptionParser()<br>parser.add_option('-n','--new',dest='new')<br><br>However, I think argparse has replaced optparse since Python 2.7 and higher...<br>
<br>HTH,<br>Jason<br></div>
</div>