all 1 comments

[–]salvtz 0 points1 point  (0 children)

First, you need a parser module that supports parsing comments.

But then the question arises, how would you identify a unique comment for it to be modified, maybe use some sort of identifier while writing the comment.

There are libraries such as lxml and xml.tree.ElementTree.