example of using pure python to create state file