Python: charmap codec can’t encode character in position character maps to

I was trying to print a list of top 10,000 rows using following. I used PTVS – Python tools for Visual Studio.

with open(“myawesomefile’) as f:
reader = csv.reader(f)
your_list = list(reader)

print(your_list)

I was getting the error.

when i did the following instead it worked. Most likely the command line doesnt want to print the 10000 rows.

print(len(your_list))

Leave a Reply

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