#!/usr/bin/python import sys #a routing to assign variable names automatically to command line arguments based on a "help list" defined here as varnames[] index=1 varnames=['Company Name', 'Address', 'Phone Number'] #spaces are to be replaced by underscores, also the user might need to quote input argcount=len(varnames) if len(sys.argv)-1 != argcount: print "Incorrect argument count" print sys.argv[0]," ",varnames[:] sys.exit(2) for arg in varnames: #create a new var with the name of each arg: Company_Name = sys.argv[1] arg_name = "_".join(arg.split(' ')) # arg_name = sys.argv[index] #obviousley not what I want to do, but you get the point print arg_name+" = "+sys.argv[index] #output showing what is supposed to happen internally index=index+1 #there must be a way of getting the index of arg instead