sys module - argv, but no argc ??
pinard at iro.umontreal.ca
Sat Aug 3 01:24:58 CEST 2002
> I've imported the sys module, and I'm SHOCKED that there is no way to
> access the argument count.
Indeed, it would be shocking if there was no way. Have more confidence
in Python design, and you will soon be happier! :-)
> The docs talk about accessing argv, but nothing about the argument count.
> Was something omitted from the docs ?
The way to get the length of a list is surely documented along with lists,
but not repeated for each and every list Python offers, that would soon
> How do Python users get around this ?
Merely by using len(sys.argv).
François Pinard http://www.iro.umontreal.ca/~pinard
More information about the Python-list