Index: abinit.py =================================================================== --- abinit.py (revisiĆ³n: 3638) +++ abinit.py (copia de trabajo) @@ -23,17 +23,12 @@ if type(filename) == str: f.close() - full_file = '' + lines = [] for line in lines: - if '#' in line: - meat, comment = line.split('#') - else: - meat = line - full_file = full_file + meat + ' ' - - full_file.strip() - tokens = full_file.lower().split() - + meat = line.split('#', 1)[0].lower() + lines.append(line) + tokens = ' '.join(lines).strip() + # note that the file can not be scanned sequentially index = tokens.index("acell")