CLRS
CLRS copied to clipboard
Write a script to insert a block comment into each code file
Such as :
//
// @author Yue Wang
// @time [read system time]
//
Seems a dictionary can be used here, like:
dic['author'] = `Yue Wang`
Sample code in Python from SO
f = open("path_to_file", "r")
contents = f.readlines()
f.close()
contents.insert(index, value)
f = open("path_to_file", "w")
contents = "".join(contents)
f.write(contents)
f.close()
tested.