Skip to content

How to read files in Python?

with open("file.txt") as file_in:
    lines = []
    for line in file_in:
        lines.append(line)
See also  Python code snippet - How to make a exe?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.