From: Henry K. <doc...@gm...> - 2021-01-08 15:01:07
|
Hi all, I am trying to get the parser to move through a list of filenames stored in a text file by simply adapting the provided example in the documentation (see below). The text files are organized with a new line after each output file. with open('filenames.txt', 'r') as pfiles: for line in pfiles: data = cclib.io.ccread(line) print(data.natom) However, print(data.natom), returns: AttributeError: 'NoneType' object has no attribute 'natom' An analogous expression is not inundated with this issue and provides the anticipated output (see below). I fail to see why this for loop would throw off the read. Any help or input would be greatly appreciated. filename = compound_condensate_5.out data = cclib.io.ccread(filename) data.natom. Kind Regards, Henry |