Skip to content

Open a file with with? #177

Closed
Closed

Activity

  1. mmcky commented on Oct 7, 2021

    @mmcky
    Contributor

    thanks @oyamad this is good feedback.

    Context managers are good in practice as they ensure open files are closed etc.

    https://book.pythontips.com/en/latest/context_managers.html#context-managers

    We do have infile.close() in that example as the file is built line-by-line.
    But if the python tutorial says we should do -- maybe we should :-).

  2. jstac commented on Dec 27, 2022

    @jstac
    Contributor

    @HumphreyYang , could you please address this issue when you have time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions