sys module - argv, but no argc ??

Tim Daneliuk tundra at tundraware.com
Fri Aug 2 09:30:02 CEST 2002


Tony C wrote:
> I've imported the sys module, and I'm SHOCKED that there is no way to
> access the argument count.
> 
> The docs talk about accessing argv, but nothing about the argument
> count.
> Was something omitted from the docs ?
> 
> How do Python users get around this ?
> 
> thanks
> 
> Tony


Try this little snippet and see for yourself:


from sys import *

argc = len(argv)
print "argv = %s       argc = %s" % (argv, argc)



-- 
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com




More information about the Python-list mailing list