testsite_array = []
with open('topsites.txt') as my_file:
for line in my_file:
testsite_array.append(line)
This is possible because Python allows you to iterate over the file directly.
Alternatively, the more straightforward method, using f.readlines():
with open('topsites.txt') as my_file:
testsite_array = my_file.readlines()