import os
print "the script name is: ",sys.argv[0]
os.system('clear')
if len(sys.argv) > 1:
print "there are", len(sys.argv)-1,"args"
we = raw_input("Do you want to list args: ")
if (we == 'yes'):
for arg in sys.argv[1:]:
print arg
else:
print "the end"
else:
print "there are no args"
#!/usr/bin/python
import sys
if len(sys.argv) <= 1:
print "no args"
else:
total = len(sys.argv)
cmdargs = str(sys.argv)
print "total: %d" % total
print "args list: %s" % cmdargs