12 lines
266 B
Python
12 lines
266 B
Python
|
from state import State
|
||
|
|
||
|
def readFile (path: str) -> State:
|
||
|
with open(path) as f:
|
||
|
lines = f.readlines()
|
||
|
|
||
|
return State.deserialize(lines)
|
||
|
|
||
|
|
||
|
def writeFile (path: str, state: State) -> None:
|
||
|
with open(path, 'w') as f:
|
||
|
f.write(state.serialize())
|