On Dec 3, 2005, at 9:40 PM, david wrote:
import pickle def save_game(state, filename): file = open(filename, 'w') pickle.dump(state, file) file.close() def load_game(filename): file = open(filename, 'r') state = pickle.load(file) file.close() return state save_game(world, 'mygame') world = load_game('mygame') -- logic (n.): the art of being wrong with confidence. |
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor