Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
I suppose the point is that in the file - a line or lines. They contain, in addition to the numbers themselves, other characters - spaces, line breaks, carriage returns, end of file, etc.
Of course, you can make it work exactly the way you do it.
But apparently, you are reinventing the wheel on crutches.
After all, you need to store some data in the file - for example, the value of a parameter.
For this, they came up with formats - for example, JSON, XML, YAML, CSV, etc.
JSON is often used - there is a built-in library for it in Python, it is well described and more than flexible for any of your needs. Try to master.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question