I'm trying to make a simple random name generator by pulling first and last names from text files. The problem I'm having is that sometimes the names are chopped off and incomplete with the output and sometimes the names are on two different lines.
I would also like to be able to make it loop such that you could press enter to get a new random name right below the first, but I'm not sure how to do that.
import random
a = random.randint(1, 10)
b = random.randint(1, 10)
space = ' '
f = open('fname.txt')
inFile = open('fname.txt')
fname = f.readline(a)
f.close()
f = open('lname.txt')
inFile = open('lname.txt')
lname = f.readline(b)
f.close()
print (fname + space + lname)
raw_input()