Skip to content

Instantly share code, notes, and snippets.

@krischer
krischer / namelist.py
Last active December 13, 2015 16:58
Token based Fortran namelist parser. Let me know if anything does not work.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Fortran namelist parser. Converts nameslists to python dictionaries.
Should be fairly robust. Cannot be used for verifying fortran namelists as it
is rather forgiving.
Error messages during parsing are kind of messy right now.