python tempfile write string