Lex Hider wrote: > Any tips on the code quality and use of python would be appreciated. I've > got a feeling the overall structure is up the creek. [...] > for opt, arg in opts: > if opt in ("-l", "--latest"): > latest = int(arg) > elif opt in ("--notfound"): > ignoreNotFound = True #add notfound files to log
Subtle bug here: ("--notfound") is not a tuple, is just a string, so what you are actually testing is whether opt is a substring of "--not-found". To actually build a 1-element tuple, you have to put a trailing comma: elif opt in ("--notfound", ): but it would be clearer if you just use: elif opt == "--notfound": -- Roberto Bonvallet -- http://mail.python.org/mailman/listinfo/python-list