On 2020-11-30 03:59, Jason Friedman wrote:

csv.DictReader appears to be happy with a list of strings representing
the lines.

Try this:

contents = source_file.content()

for row in csv.DictReader(contents.decode('utf-8').splitlines()):
     print(row)


Works great, thank you! Question ... will this form potentially use less
memory?

for row in
csv.DictReader(source_file.content().decode('utf-8').splitlines()):
     print(row)

Yes, but it won't matter that much unless there's a _lot_ of data.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to