After the revisions to the question, this is a working piece of code that will give you output. Not sure if it is exactly what you want, but it will work.
#!/usr/bin/python
from optparse import OptionParser
class Permutate:
email_dict = {}
email_provider = (
'@gmail.com',
'@aol.com',
'@yahoo.com'
)
def __init__(self, fname, lname):
'''
vars:
[fname] - first name of the permutation
[lname] - last name of the permutation
[email_combination] - first and last name
'''
assert isinstance(fname, str) and isinstance(lname, str), "Only strings may be supplied as names"
self.fname = fname
self.lname = lname
self.email_combination = fname + "." + lname
for provider in Permutate.email_provider:
print "%s%s" % (self.email_combination, provider)
def compute_first_last():
'''
compute_first_last():
email_combination = <string> + <string> + <string>
computes the first name and last name combination plus and email provider.
Loop through all combinations of first + last + email_provider while the value *is u
A single combination looks like <fname>.<lname>@<email_provider>
'''
parser = OptionParser(usage='%prog -f fname -l lname', version='%prog 1.1')
parser.add_option('-f', '--fname', dest='fname')
parser.add_option('-l', '--lname', dest='lname')
(opt, args) = parser.parse_args()
perm = Permutate(opt.fname, opt.lname)
if __name__ == '__main__':
compute_first_last()