Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #196378 > unrolled thread

Re: Best use of "open" context manager

Started by2QdxY4RzWzUUiLuE@potatochowder.com
First post2024-07-06 07:09 -0400
Last post2024-07-06 07:09 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Best use of "open" context manager 2QdxY4RzWzUUiLuE@potatochowder.com - 2024-07-06 07:09 -0400

#196378 — Re: Best use of "open" context manager

From2QdxY4RzWzUUiLuE@potatochowder.com
Date2024-07-06 07:09 -0400
SubjectRe: Best use of "open" context manager
Message-ID<mailman.4.1720265784.2981.python-list@python.org>
On 2024-07-06 at 11:49:06 +0100,
Rob Cliffe via Python-list <python-list@python.org> wrote:

> Is there a better / more Pythonic solution?

https://docs.python.org/3/library/fileinput.html

At least this attempts to abstract the problem of iterating over a file
(or multiple files) into a library routine.  I've used it a little, but
I don't know the full depths of your use case and/or requirements.

HTH,
Dan

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web