count arguments

#!/usr/bin/python
import sys
print len(sys.argv)


OUTPUT:
[root@mysql Scripts]# python argu.py
1
[root@mysql Scripts]# python argu.py 3
2
[root@mysql Scripts]# python argu.py 3 2
3
[root@mysql Scripts]# python argu.py 3 2 4
4
[root@mysql Scripts]# python argu.py 3 2 4 6
5
[root@mysql Scripts]# python argu.py 3 2 4 6 7 8
7

Comments

Popular posts from this blog

How to delete SEA in VIOS

Webmin configuration for LDAP

CPU speed webpage "http://www.spec.org/cpu2006/results/cint2006.html"