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

More VIOS commands

Webmin configuration for LDAP