[python] Writing a dict to txt file and reading it back?