The following lines are pretty messy:
TempInt = 0
GeneratedNameArray = [] # initiate another array
GeneratedName = ''
while TempInt != number:
RandNumb1 = random.randint(1,len(ListOfNames)-1)
RandNumb2 = random.randint(1,len(ListOfNames)-1)
GeneratedNameArray.append(ListOfNames[RandNumb1]+' '+ListOfNames[RandNumb2])
TempInt = TempInt + 1
First, you have declared the
GeneratedName variable, but you are not using it anywere in the code. Second, your while loop doesn't look right, something iike this would be better:
while len(GeneratedNameArray) <= number:
#do_something()
Third, you are not checking for duplicate names. Also, using the
choice() method from the random module would be much better instead of generating pseudo-random integers.
Therefore, the above code could just become:
GeneratedNameArray = []
while len(GeneratedNameArray) <= number:
name = '{0} {1}'.format(random.choice(ListOfNames), random.choice(ListOfNames))
if not name in GeneratedNameArray:
GeneratedNameArray.append(name)
There are more optimization which could be done like appending the names to the output file straight from the while loop and like I said in one of the other topics, the
GetFromArg function is pretty useless. Again, you should definitely read about the naming conventions in Python and it's syntax (PEP8).