Essentially I want to suck a line of text from a file, assign the characters to a list, and create a list of all the separate characters in a list -- a list of lists.
At the moment, I've tried this:
fO = open(filename, 'rU')
fL = fO.readlines()
That's all I've got. I don't quite know how to extract the single characters and assign them to a new list.
The line I get from the file will be something like:
fL = 'FHFF HHXH XXXX HFHX'
I want to turn it into this list, with each single character on its own:
['F', 'H', 'F', 'F', 'H', ...]
itertools.chain
is really the simplest for this --chars = list(itertools.chain.from_iterable(open(filename, 'rU)))
. – Pachalic