Ashwini
Ashwini

Reputation: 393

Parse an a2l file in python

I need to read an a2l file in python, make some modifications to the file itself based on a function and save it again to an a2l file. As far as I have checked there is a library 'pya2l' (https://github.com/Sauci/pya2l) in python but the examples aren't complete. In this library, a2l string has to be given as such and there isn't any way to read a file as it is.

Kindly share your feedback if you have any suggestions!

Upvotes: 2

Views: 6212

Answers (1)

srinivast6
srinivast6

Reputation: 337

You can convert the content of a2l file to string and use that string.

a2l_string = open(r'C:\Users\vaasu\Desktop\Data\examples\ASAP2_Demo_V161.a2l', 'r').read()

or

you can checkout this library Another library

Upvotes: 1

Related Questions