1

File "D:\Users\AppData\Local\Continuum\anaconda\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0]

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 603: character maps to

nassiri
  • 11
  • 2

1 Answers1

1

you must use encoding="utf-8" when you are opening a file:

with open("filename.extension", "r+", encoding="utf-8") as file:
  # file.readlines()
  # file.read()
  # choose one of these
  pass
alexzander
  • 1,586
  • 1
  • 9
  • 21
  • Already done on the initial script as ####################################### devices_from_Excel = Extracting_data_from_Excel(Excel_File) global_row = 0 print (devices_from_Excel ) book = xlwt.Workbook(encoding="utf-8") sheet = book.add_sheet("ASR903_free_ports") – nassiri Jan 13 '22 at 14:47