I have saved a list of ticker symbols into a text file as follows:
MMM ABT ABBV ANF ....
Then I use readlines to put the symbols into a Pyt
You could do it like this:
stocks = open(textfile).read().splitlines()