On 02/01/2013 11:31 PM, Scurvy Scott wrote:

> Steve-
> thanks a lot for showing me the if __name__ = main part
> I've often wondered how it was used and it didn't make sense until I
> saw it in my own code if that makes any sense.
> Also appreciate the help on the "instructional" side of things.
>
> One question related to the instruction aspect- does this make sense to you?
>
> If len(sys.argv) == 0:
> print "usage: etc etc etc"


If should not be capitalized; sys.argv always has the name
of the script as the first item.

So you need to do something like:

if len(sys.argv) != 3:
    print "usage: ..."

HTH!  -m


--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

Emotion is primarily about nothing and much of it remains about nothing to
the end.  George Santayana

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to