I'm very new in Python and I need to modify a configuration file. I'm able to do so using configparser but the problem is that I need to keep the comments in the config file and it seems that it is not possible with it. I found Update INI file without removing comments, but the problem is not completely solved.
The apparent solution is to use ConfigObj
but the comments say that it's obsolete so I don't want to use this approach.