<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Which style convention is it referring to? Should these really be all<br>caps?<br></blockquote>
</div><br>I think pylint is expecting that any variables declared outside of a
function should be constants with special meanings (similar to #define or enum
values in c). So, I guess to get rid of that message you should do something like this:<br><br><code><br>def main(args=None):<br> if args is None:<br> args = sys.argv<br><br> parser = optparse.OptionParser
(usage='usage: %prog [OPTIONS]')<br> parser.add_option('-c', '--config',<br> action='store',<br> type='string',<br> dest='configFilename',
<br> help='config file containing defaults')<br> (options, args) = parser.parse_args(args)<br><br>if "__main__" == __name__:<br> sys.exit(main())<br></code><br><br>Here is an article by GvR that goes over main functions in python:
<a href="http://www.artima.com/weblogs/viewpost.jsp?thread=4829">http://www.artima.com/weblogs/viewpost.jsp?thread=4829</a>. You didn't really ask for it, but I think it is good reading. His examples all use getopt though, instead of optparse. I have come up with my own (probably overkill for 99% of python scripts) template that uses optparse. If you really want to see it let me know and I will send it to you.
<br><br>Matt<br>