Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 202 Bytes

File metadata and controls

17 lines (13 loc) · 202 Bytes

In-memory text stream with StringIO

from io import StringIO

csv_data = """
name,age
Alice,49
Bob,2
Charlie,14
""".strip()

csv_file = StringIO(csv_data)

for line in f:
    print(line)