@staticmethod<EOL><INDENT>def read_from_file(filename):<DEDENT>
with open(filename) as f:<EOL><INDENT>result = CP2KInputFile()<EOL>try:<EOL><INDENT>while True:<EOL><INDENT>result.load_children(f)<EOL><DEDENT><DEDENT>except EOFError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return result<EOL>
Arguments:
 | ``filename``  --  the filename of the input file

Use as follows::

  >>> if = CP2KInputFile.read_from_file("somefile.inp")
  >>> for section in if:
  ...     print section.name