YanoSec / Code Review card. Do not save this as a .py file and do not run it. The line labels keep it from being a program. Line A: def publish(path): Line B: with open(path, encoding="utf-8") as handle: Line C: data = handle.read() Line D: print(data) Line E: # comment says: safe to share Line F: with open(path, "w", encoding="utf-8") as handle: Line G: handle.write("replaced") Input: the file named by path, read as UTF-8 text. Display output: print(data). Comment: line E. A comment does not change what line F does. Modifying part: lines F and G. Mode w discards an existing file’s contents when open succeeds, before the write. The read on lines B and C does not replace the file.