excelUtilities.py file corrupted

Dear 3DS,

I want to put .odb output into an Excel file using a .py script. However, it will not load the file excelUtilities.py for me. It has to do with the characters in the excelUtilities.py file.

Originally it was a .pyc compiled file. I only changed the file extension, but apparently this doesn't work.


The error that I get is the following (see attached code and .py file in .txt form):

File "C:Users/marhe/EQ1-Excel.py", line 6, in

import abq_ExcelUtilities.excelUtilities
SyntaxError: ('invalid syntax', ("Non-ASCII character '\\\\xf3' in file C:\\\\SIMULIA\\\\CAE\\\\2022LE\\\\win_b64\\\\code\\\\python2.7\\\\lib\\\\abaqus_plugins\\\\excelUtilities\\\\abq_ExcelUtilities\\\\excelUtilities.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details",
('C:\\\\SIMULIA\\\\CAE\\\\2022LE\\\\win_b64\\\\code\\\\python2.7\\\\lib\\\\abaqus_plugins\\\\excelUtilities\\\\abq_ExcelUtilities\\\\excelUtilities.py', 1, 0, None))

I have already tried putting the following code above all the other code in the file:
# -*- coding: utf-8 -*-

However, this doesn't yield any results. Another error comes forth:

SyntaxError: ('invalid syntax', C:\\\\SIMULIA\\\\CAE\\\\2022LE\\\\win_b64\\\\code\\\\python2.7\\\\lib\\\\abaqus_plugins\\\\excelUtilities\\\\abq_ExcelUtilities\\\\excelUtilities.py, 2, 1, '\\x03\\xef\\xbf\\xbd\\n')


Chat GPT tells me that the excelUtilities.py file should be a valid Python script with ASCII characters only and that I should ask the software provider to help me.

Please let me know if there is anything I can do to change this.

Kind regards,

Martin Dirkzwager

Edu ​​​​​​​SIMULIA ​​​​​​​