Python file handling cheat sheet