tickers = [] def parseRus(): try: readFile = open('russell3000.txt','r').read() splitFile = readFile.split('\n') for eachLine in splitFile: splitLine = eachLine.split(' ') ticker = splitLine[-1] tickers.append(ticker) print tickers except Exception,e: print 'failed in the main loop',str(e) parseRus()