Skip to content

file iteration #12

Open
Open
@kylerlaird

Description

@kylerlaird

I'm enjoying your document! I've been moving away from Bash to Python scripting for years. I'm always looking for better ways to do it.

I'm curious about the section on iterating through lines of a file. You provide some relatively complicated ways to do it using "with", readline(), etc. Why not simply "for line in open(file):"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions